Skip to content
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

Websocket is null in case of Socks proxy #60

Open
michedsa opened this issue Nov 2, 2021 · 0 comments
Open

Websocket is null in case of Socks proxy #60

michedsa opened this issue Nov 2, 2021 · 0 comments

Comments

@michedsa
Copy link

michedsa commented Nov 2, 2021

Hi, I implemented this part of code to connect to a Websocket via SOCKS proxy but the websocket returned is always null. Is it supported?

ProxyServer.Builder socksProxy = Dsl.proxyServer(socksAddress);
socksProxy.setProxyType(ProxyType.SOCKS_V5);

        Builder config = Dsl.config();
        DefaultAsyncHttpClientConfig.Builder as = config.setProxyServer(socksProxy.build());
        AsyncHttpClient ahClient = Dsl.asyncHttpClient(as);

        WebSocketUpgradeHandler.Builder wsbuilder = new WebSocketUpgradeHandler.Builder();

        WebSocketListener mywebSocketListener = new MyWebSocketListener();
        try {
            WebSocketUpgradeHandler handler = wsbuilder.addWebSocketListener(mywebSocketListener).build();

            websocket = ahClient.prepareGet(SODConfiguration.getInstance().getWSUrl()).execute(handler).get(1, TimeUnit.SECONDS);

           
        } catch (Exception e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant