Websocket client via proxy host

I need to use a standard websocket client on a network that uses a proxy host for all outbound traffic. I was wondering if people have recommendations for a websocket client library that can be configured for using a proxy host?

1 Like

That is not really a websocket thing, but rather the underlying TCP connection kind of thing.

As for the websocket client, if it is in the browser then the proxy is handled by the browser, no way to control that from javascript, this generally defaults to the OS stock proxy.

If it is standalone program then it should also default to the OS stock proxy, which it probably is set if it is a proxy for ‘all’ outbound traffic. Otherwise setting it manually depends on the client language that the program is written in. :slight_smile:

3 Likes

OvermindDL1, appreciate the reply. I think part of my question is related to “what I don’t know :)” about the intricacies of tcp.

Hampered by my own lack of knowledge and misunderstandings, let me further explain. I have an application that is going to run on a clients network.

In developing a solution I spun up a proxy server using Squid on a linux box. Using nodejs websockts (faye-websocket) I can easily set proxy options and verify communications are routed through the local proxy server.

I would like to use elixir for this project, but I also need to make sure that I can support websockets via ssl and via a proxy. My current exploration of websocket libraries it has not been clear how to configure them for use with proxy. It maybe that I simply configure gen_tcp, but that has not been obvious either.

Pointers or clarifications welcome.

1 Like

Is the proxy on the server side or the client side? If the server side then you don’t need to do anything as long as the proxy is half-decent. If the client side then you just need to setup the client to use the proxy (if not already built into the network stack of the OS you are running on).

Squid works fine, I barely even touched its config when I ran it. There should not need to be anything you do on the server side, not even ruby or node or so. If on the client side, well that depends on what language the client is in, what os, etc…

1 Like