-
Notifications
You must be signed in to change notification settings - Fork 143
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
ignoring proxy settings ? #99
Comments
@Frintrop thanks for the report. I'm not sure I understand the problem. I see you're instantiating a new new InetSocketAddress("10.100.0.100", 8081) Do you have an HTTP proxy available on 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 |
I saw the source of the proxy setting of pusher, then i found that the proxy does not effective; In if (uri.getScheme().equals(WSS_SCHEME)) {
try {
SSLContext sslContext = SSLContext.getInstance("TLS");
sslContext.init(null, null, null); // will use java's default
// key and trust store which
// is sufficient unless you
// deal with self-signed
// certificates
final SSLSocketFactory factory = sslContext.getSocketFactory();// (SSLSocketFactory)
// SSLSocketFactory.getDefault();
**setSocket(factory.createSocket());**
}
catch (final IOException e) {
throw new SSLException(e);
}
catch (final NoSuchAlgorithmException e) {
throw new SSLException(e);
}
catch (final KeyManagementException e) {
throw new SSLException(e);
}
}
this.webSocketListener = webSocketListener;
setProxy(proxy); And then, in try {
if( socket == null ) {
**socket = new Socket( proxy );**
} else if( socket.isClosed() ) {
throw new IOException();
}
if( !socket.isBound() )
socket.connect( new InetSocketAddress( uri.getHost(), getPort() ), connectTimeout );
istream = socket.getInputStream();
ostream = socket.getOutputStream();
sendHandshake();
} catch ( /*IOException | SecurityException | UnresolvedAddressException | InvalidHandshakeException | ClosedByInterruptException | SocketTimeoutException */Exception e ) {
onWebsocketError( engine, e );
engine.closeConnection( CloseFrame.NEVER_CONNECTED, e.getMessage() );
return;
}
writeThread = new Thread( new WebsocketWriteThread() );
writeThread.start(); |
@GeekQing I think your steps-to-reproduce are:
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 Unfortunately |
@jameshfisher I'm facing the same issue. In WebSocketClientWrapper
|
Did i a mistake ?
The text was updated successfully, but these errors were encountered: