I am trying to establish a WebSocket connection using Spring StandardWebSocketClient, but getting an error due to proxy settings as the server is running behind the proxy. Below is the code I am using.
StandardWebSocketClient aStandardWebSocketClient=new StandardWebSocketClient();
WebSocketConnectionManager manager = new WebSocketConnectionManager(aStandardWebSocketClient, new WebSockethandler(), aWebSockURL);
Able to make a rest call by setting proxy configuration successfully.
Is there any proxy configuration available for making StandardWebSocketClient connect to websocket server?
SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory();
InetSocketAddress address = new InetSocketAddress("proxyHost",8080);
Proxy proxy = new Proxy(Proxy.Type.HTTP,address);
factory.setProxy(proxy);
restTemplate.setRequestFactory(factory);