Question

We're having a weird problem at work and I'm hoping someone here can give me some ideas on how to troubleshoot it.

The problem is that I cannot make websocket connections from my Kubuntu 13.10 workstation. I've tried from both Chrome and Firefox. I'm behind a proxy and first I thought that must be the reason. However, I got some coworkers to try to connect to the same websocket echo demo and all of them were able to, except one. He was the only one running Ubuntu (same as me), the others were on Mac, Windows and even one on RedHat! Theirs all worked fine.

Ok, so now for the really weird part. I created and ran a virtual machine on my workstation (the one that couldn't connect). The VM is a Lubuntu 13.10 and what do you know, the darn thing establishes a websocket connection just fine!

So any ideas on how to troubleshoot this or even some suggestions for solutions would be very much appreciated.

Was it helpful?

Solution

Ugh... well that one was dumb.

So it turns out that in Linux you can check a checkbox in your Network Proxy settings (the system settings) that will use the same proxy for all protocols.

Yeah... don't do that!

Unless, that is, your proxy server supports SOCKS as well as HTTP/HTTPS/FTP (highly unlikely).

It turns out that if you check that checkbox, your proxy server will be registered as a SOCKS proxy and for some reason, websocket connections in both Chrome and Firefox will want to use that. So your HTTP proxy will end up getting a bunch of weird SOCKS handshakes that it doesn't understand and any websocket connection will fail.

This was tested on both Ubuntu and Kubuntu and the "problem" exists on both.

TL;DR; Don't check the "Use this proxy server for all protocols" checkbox unless your proxy server supports the SOCKS protocol. Instead, manually fill in the same server for the different protocols (http, https and ftp) but leave the socks protocol empty (or point to an actual socks proxy server).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top