-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
node-http-proxy and websockets #577
Comments
@rere16 you also have to proxy the web requests in the |
Thank you very much for your answer. But, I have no idea how to do this. Please, could you give me a short example ? Thanks |
@rere16 well lets start with why do you want to proxy the websocket connection to another server when you already have an http server that you can then attach the websocket server to as well? |
Because I developed an application using websocket (port 8080) and I would like that this application communicates with the client through the webserver (port 80). By proxing, only the port 80 is open. The port 8080 is local. (The webserver and the application is on the same machine) |
@rere16 ahh ok, I guess my argument is why are they two separate applications? The tricky part here is that you will have to custom proxy based on the particular requests that initialize the websocket connection. |
There are two applications because one is an application written in C++ using websocket and the other is the webserver (nodejs). I just want to redirect the websocket stream between the client and the application (no cache). It's a routing proxy feature. For example with apache (port 80) Location /ws The request ws://127.0.0.1:80/ws will be redirect to ws://127.0.0.1:8080/ws. Thx |
@rere16 I am also in this situation. I have websocket server written in c++ and generating some data and I want to use node-http-proxy. Please let me know if you did this already |
Did some one find the solution for this problem? |
+1 |
The javascript source code in my first message works. I had an issue in my C++ program. |
Hello,
I am using node-http-proxy to route websocket from port 80 to port 8080. I have a http server (port 80). I would like to create a websocket connection between the client and the server through the nodejs server. I use the following source code :
But, the server only receives the handshake message and the connection closes (eof). I tested with apache and proxy_mod, the server works fine.
Any idea ?
Thank you very much.
The text was updated successfully, but these errors were encountered: