-
Notifications
You must be signed in to change notification settings - Fork 56
Does it support connection through a proxy server? #3
Comments
Sorry, it's not yet supported. |
I understand, but I need a workaround, could you show me how to handle proxy in jawampa? I would implement it in my fork. |
I quickly hacked something together by backporting some of Netty 4.1 proxy support to 4.0 and including that in the repo. You can try it out by using the |
Thank you for quick reply! Unfortunatelly, it doesn't work, I even switched to Netty 4.1.0.Beta4-SNAPSHOT to get proxy support implemented in netty/netty#2817 (see my fork), but it also doesn't work. I have no idea how to fix it, because I didn't work with Netty before that, I hope that they will fix it soon. |
I tried to debug it and found out that my backport to Netty 4.0 caused a nullpointerconnection which lead the connection to failing. I pushed an update to the proxy branch with which I can at least connect to a proxy and get a positive response from it. Couldn't test the complete WAMP connection as I have no remote server for it. Then there's some kind of race condition left: |
Ok, I can successfully connect to the crossbar demo through a proxy with this configuration:
|
@Matthias247, should I be able to connect to
|
@KMax Yes, you should also be able to connect to that server. It's the server that is used in the official crossbar demos (https://demo.crossbar.io/demo/pubsub/index.html). |
Hmm...it's strange, I get
|
Solved it! The issue is described here. I just needed to install pyOpenSSL from sources as it said in Secure WebSocket and HTTPS tutorial. Now I can connect to my WAMP router, but still I can't connect to |
Glad you are achieving progress. I'm afraid I can't help you that much on the issues. From the log you have posted I'm not really sure whether you are facing an SSL or a websocket error. While some lines point to SSL there is also this one:
This points out that the websocket server does not respond correctly to our websocket handshake. In such cases Netty would close the connection. For debugging whether the proxy let's you establish a tunneled connection I would proceed as written above: |
So now everything works fine for one of my Java apps which is a simple CLI application, I even can use jawampa without the patch from No, I'm testing SSL (without proxy for now) on a web application running on Wildfly 8.1.0.Final and for some reason it doesn't work. I get the following exception:
The full log:
|
I've just pushed a fix for HTTP proxy handler to 4.1. You might want to try it out and let me know if you don't need to fork anymore or there's still a problem. |
@trustin Thank you very much for informing me about the update! I guess its this commit? Regarding the fork/branch thing: This is still needed because there is no official Netty 4.1 maven release which contains the proxy support. Therefore I needed to copy the proxy related files (and did a quick&dirty backport to 4.0). As this solutions was not that clean I didn't want to have it in the master branch. I will wait for 4.1 with proxy support there. |
@Matthias247 Thanks for getting back to me. I hope to release 4.1 as soon as possible, although it's always time that I'm in short of .. |
Hi @Matthias247 , We are trying to use your java wamp implementation and now we facing the problem with passing through proxy server. Going through this thread i know that current version (0.4.1) does not supports proxy traversing because Netty supports proxies only starting from 4.1. Having this, i took netty 4.1.0-Beta7 version, jawampa 0.4.1 version and code from WampClientChannelFactoryResolver#getFactory method (from your proxy branch) but failed to pass the proxy - both ws and wss. ChannelPipeline p = ch.pipeline(); Client does not get handshake from server: with WireShark i can see that proxy gets some ACK from server but then nothing happens. If i terminate server then client understands that there is disconnection and client tries to reconnect (but obviously fails). Can you please point me on what i am doing wrong? Or miss? Thank you in advance, |
Hi @genadi-hp |
Hi @genadi-hp, I found this issue when googling about an issue with Netty, WebSockets, and HTTP proxy. I'm posting my latest findings here in the hope one can find them useful. First you should be aware that:
This is my lab setup:
This works:
This fails:
One day I'll try this:
After a lot of investigations at the wrong places, I discoved that Netty's It seems that you hit more or less the same problem than me. Don't spend time using |
Does the library support connection through a proxy server? I want to run the library behind a proxy server to connect to a WAMP router, but it hangs on the connecting phase...Thank you in advance!
BTW: the
http_proxy
environment variable is set.The text was updated successfully, but these errors were encountered: