Hey there, I’m pretty sure I found a bug.
Today when working I was having trouble to get my browser to connect to a WebSocket server on my local machine.
After a long time of trial and error I found out that the issue vanishes as soon as the Kee Extension is disabled and appears again as soon as it’s back online.
It is fairly easy to reproduce:
- Open a WS server locally. I used node and the
ws
package:
const WebSocket = require('ws');
const ws = new WebSocket.Server({ port: 80 });
ws.on('connection', socket =>
{
console.log('New connection!');
socket.close();
});
- Open Firefox with Kee installed and enabled (not connected to Keepass, not sure if it makes a difference but I guess that it does)
- Go to
about:blank
and open the DevTools (Ctrl + Shift + I) - Use the console to run
const ws = new WebSocket('ws://127.0.0.1/');
ws.onopen = () => console.log('Connected!');
- Refresh the page
- Goto step 4
When I do this on my machine and Kee is installed, the time between calling new Websocket
and actually starting a connection gets increasingly slower until it is the slowest at roughly 70 seconds. This might match the reconnect timeout used in WebsocketSession.ts
of the addon. I can’t tell if they are related though, I haven’t looked thorugh the code very long.
I have to do a full restart of the browser to fix the issue. It seems to only affect connections via localhost
or 127.0.0.1
. I have not tested this out in Chromium.
Have a nice day!