slackapi / java-slack-sdk

Slack Developer Kit (including Bolt for Java) for any JVM language
https://tools.slack.dev/java-slack-sdk/
MIT License
578 stars 215 forks source link

Upgrade Tyrus WebSocket client library (used in Socket Mode client ) to v2 #972

Open gillbates opened 2 years ago

gillbates commented 2 years ago

(Describe your issue and goal here)

Reproducible in:

mvn dependency:tree | grep com.slack.api
gradle dependencies | grep com.slack.api
java -version
sw_vers && uname -v # or `ver`

The Slack SDK version

    implementation 'com.slack.api:bolt-socket-mode:1.21.1'
    implementation "javax.websocket:javax.websocket-api:1.1"
    implementation "org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17"

Java Runtime version

openjdk version "17.0.1" 2021-10-19 LTS
OpenJDK Runtime Environment Zulu17.30+15-CA (build 17.0.1+12-LTS)
OpenJDK 64-Bit Server VM Zulu17.30+15-CA (build 17.0.1+12-LTS, mixed mode, sharing)

OS info

ProductName:    macOS
ProductVersion: 12.3.1
BuildVersion:   21E258
Darwin Kernel Version 21.4.0: Fri Mar 18 00:46:32 PDT 2022; root:xnu-8020.101.4~15/RELEASE_ARM64_T6000

Steps to reproduce:

 AppConfig appConfig = AppConfig.builder().singleTeamBotToken(mainApp.botOauthToken).build();

        appConfig.getSlack().getConfig().setProxyUrl("http://localhost:7890/");

        mainApp.app = new App(appConfig);
        SocketModeApp socketModeApp = new SocketModeApp(mainApp.appToken, SocketModeClient.Backend.Tyrus, mainApp.app);

Expected result:

can we support socks5 proxy for both slack http api and websocket api

Actual result:

Apr 17, 2022 10:06:30 PM org.glassfish.tyrus.container.grizzly.client.GrizzlyClientSocket addProxies
INFO: Socks proxy is not supported, please file new issue at https://java.net/jira/browse/TYRUS. Proxy 'SOCKS @ 127.0.0.1/<unresolved>:7890' will be ignored.
seratch commented 2 years ago

HI @gillbates, thanks for writing in!

We are planning to upgrade to Tyrus v2 in the next major version: https://github.com/slackapi/java-slack-sdk/issues/919 That being said, this SDK's v2 won't come in the short term (at least, we are not planning to work on it this year).

If this issue is urgent for you, please consider implementing your own SocketModeClientTyrusImpl for now.

gillbates commented 2 years ago

HI @gillbates, thanks for writing in!

We are planning to upgrade to Tyrus v2 in the next major version: #919 That being said, this SDK's v2 won't come in the short term (at least, we are not planning to work on it this year).

If this issue is urgent for you, please consider implementing your own SocketModeClientTyrusImpl for now.

Hi @seratch

thx for the clarify. Tyrus 1.7 is really buggy and very outdated.

Currently there are lot of needs for proxy support for both http api and websockets. Maybe we could provide an official workround?

seratch commented 2 years ago

If I understand correctly, Tyrus v2 does not support SOCKS proxies out-of-the-box too. The logging part is still the same: https://github.com/eclipse-ee4j/tyrus/blob/2.0.2/containers/grizzly-client/src/main/java/org/glassfish/tyrus/container/grizzly/client/GrizzlyClientSocket.java#L594-L598

Currently, this SDK supports only HTTP proxy and many of the use cases that we are aware have been covered by that. That being said, when any of the underlying WebSocket libraries support SOCKS5 proxies, we can provide tools for the use cases.

As for the oldness of Tyrus v1.17, indeed the version was released in 2020. The Tyrus team released v1.18 a few months ago but this project haven't upgraded the depending version yet. We will specify v1.18 instead since the next release. Also, if we see more demands on Tyrus v2 support in prior to this SDK's v2 release, we may consider adding a separate optional module for it (like we do for Jetty v11 supports).

https://search.maven.org/artifact/org.glassfish.tyrus/tyrus-client

Thanks again for sharing this and it'd be appreciated if you could understand this.

Rajkumar0718 commented 1 year ago

Hai , i am connect websocket throw tyrus-standalone-client version 1.19 for chrome version 109.0.5414.119-1 it working fine ,but now chrome version is upgraded to 112 .i can't able to connect to browser . so i used tyrus-standalone-client version 2.1.3 it throws a handshake error. why ?what is the reason?