Websockets and antivirus software

362 views
Skip to first unread message

Serge S. Koval

unread,
Dec 5, 2011, 4:17:37 PM12/5/11
to sockjs
Hi,

I have few questions regarding SockJS behavior with "rogue" antivirus
software.

After some experience with socket.io and websockets, there's serious
problem with some antivirus software: if websockets are served through
the port 80, some AV software will "break" them - connection will be
established (header exchange will complete), but no data will be
transferred over the channel and connection will be closed due to
timeout.

Unfortunately, current version of socket.io does not handle this
situation gracefully - it won't even fallback to the polling
transport. Server does not do any kind of connection probing, so
application will also think that connection is up and running,
messages will be flushed, etc.

How SockJS will handle this situation?

Thanks,
Serge.

Marek Majkowski

unread,
Dec 5, 2011, 5:28:40 PM12/5/11
to serge...@gmail.com, sockjs

I wasn't aware that's a big deal, quite interesting!

When I started working on SockJS i had a feeling that it's not enough
to claim that the connection is open just after we got 'onopen' event
on websocket connection. In the end it is possible a situation as you
described - connection technically opened but unable to exchange data
(that's why the binary handshake was introduced in draft!).

As for now, there is a little framing involved in SockJS, even on
top of websockets, (BTW, take a look at sockjs-protocol if you haven't already:
http://sockjs.github.com/sockjs-protocol/sockjs-protocol-0.1.html )

Client can only claim that the connection is open when it successfully
received an 'open' frame from the server. If it can't - the normal
fallback protocol thing will be started. Unfortunately, before that
happens there is a timeout involved (5s by default). I hope to improve
that in sockjs 0.2 - reduce the timeout and it way faster.

I'm not sure if that covers the antivirus case - is the communication
blocked in both directions? (if so, sockjs will work fine, ws will
just be treated as unavailable after the timeout). Or is only upload
screwed? (this would be quite bad).

Thanks for pointing it out, I'll try to understand what's happening,
reproduce it and make sure sockjs 0.2 will deal with this issue
correctly :)

Marek

Reply all
Reply to author
Forward
0 new messages