You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Frintrop thanks for the report. I'm not sure I understand the problem. I see you're instantiating a new java.net.Proxyusing this constructor. I think you want to instantiate the InetSocketAddress like this:
newInetSocketAddress("10.100.0.100", 8081)
Do you have an HTTP proxy available on 10:100.0.100:8081?
When you say 8081 does not exist, what do you mean?
What happens when you run your program? What error do you see?
@jpatel531 could we add an example of using setProxy to the README?
Create a Pusher connection to a WSS (TLS) endpoint
The expected behavior would be that it uses the proxy as an "SSL tunnel". The actual behavior, it seems, is to ignore the proxy setting in this case. The reason is that, if we're using TLS, we create a TLS socket and set this on the WebSocketClient, which then causes the WebSocketClient to ignore the proxy setting. (I haven't tested this.)
Unfortunately javax.net.ssl doesn't seem to support "tunnelling" out-of-the-box, e.g. I can't see where we can pass it a java.net.Proxy object. Google's first result is this hairy example, which I don't want to get into.
It looks like this is a regression. I modified PR #176 from @bendav02 to work with the new version of java_websocket. Will you please add this fix to the next version? New PR is #259
Activity
jameshfisher commentedon Mar 11, 2016
@Frintrop thanks for the report. I'm not sure I understand the problem. I see you're instantiating a new
java.net.Proxy
using this constructor. I think you want to instantiate theInetSocketAddress
like this:Do you have an HTTP proxy available on
10:100.0.100:8081
?When you say 8081 does not exist, what do you mean?
What happens when you run your program? What error do you see?
@jpatel531 could we add an example of using
setProxy
to the README?GeekQing commentedon Jan 18, 2018
I saw the source of the proxy setting of pusher, then i found that the proxy does not effective;
In
WebSocketClientWrapper
, there set socket throughSSLSocketFactory
;And then, in
WebSocketClient.run()
, the socket has already initialized, do not use theproxy
parameter to construct;@jameshfisher
jameshfisher commentedon Jan 18, 2018
@GeekQing I think your steps-to-reproduce are:
PusherOptions
The expected behavior would be that it uses the proxy as an "SSL tunnel". The actual behavior, it seems, is to ignore the proxy setting in this case. The reason is that, if we're using TLS, we create a TLS socket and set this on the
WebSocketClient
, which then causes theWebSocketClient
to ignore the proxy setting. (I haven't tested this.)Unfortunately
javax.net.ssl
doesn't seem to support "tunnelling" out-of-the-box, e.g. I can't see where we can pass it ajava.net.Proxy
object. Google's first result is this hairy example, which I don't want to get into.bendav02 commentedon Mar 8, 2018
@jameshfisher I'm facing the same issue.
I'm not an expert, but would providing a (properly) connected socket to the socket factory work:
In WebSocketClientWrapper
fix bug pusher#99 ignoring proxy settings
stnelso2 commentedon May 7, 2020
It looks like this is a regression. I modified PR #176 from @bendav02 to work with the new version of java_websocket. Will you please add this fix to the next version? New PR is #259