Skip to content

Websocket is null in case of Socks proxy  #60

Description

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();
        }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions