Repository navigation
SocketModeApp (JavaWebSocket) does not support proxy with username:password #792
Description
Activity
If I specify user:pass in url I get the following
11:14:47.879 [main] DEBUG c.s.api.socket_mode.SocketModeClient - The SocketMode client's going to use an HTTP proxy: http://user:pass@proxy:port Exception in thread "main" java.lang.NullPointerException at com.slack.api.util.http.ProxyUrlUtil.setProxyAuthorizationHeader(ProxyUrlUtil.java:66) at com.slack.api.socket_mode.impl.SocketModeClientJavaWSImpl$UnderlyingWebSocketSession.<init>(SocketModeClientJavaWSImpl.java:230) at com.slack.api.socket_mode.impl.SocketModeClientJavaWSImpl$UnderlyingWebSocketSession.<init>(SocketModeClientJavaWSImpl.java:212) at com.slack.api.socket_mode.impl.SocketModeClientJavaWSImpl.<init>(SocketModeClientJavaWSImpl.java:114) at com.slack.api.socket_mode.impl.SocketModeClientJavaWSImpl.<init>(SocketModeClientJavaWSImpl.java:79) at com.slack.api.socket_mode.impl.SocketModeClientJavaWSImpl.<init>(SocketModeClientJavaWSImpl.java:70) at com.slack.api.Slack.socketMode(Slack.java:154) at App.main(App.java:52)Hi @doncorsean ! I'm sorry you stumbled upon this issue. I am new to the project but let me see if I can help you at least find a workaround for this problem.
We do have some tests covering this code path (see the
AuthProxyUserPasswordTest.javatest suite) - but it seems like we have ignored / commented out one test that instantiates theSocketModeClientin the same way that you do (by passing it aJavaWebSocketBackend).That said, the tests that don't explicitly specify a
Backend(and, from the looks of the code, executes with the "Tyrus" Backend) seem to pass. So perhaps you can try that? Something like this:SocketModeClient client = slack.socketMode(appToken);... instead of:
SocketModeClient client = slack.socketMode(appToken, SocketModeClient.Backend.JavaWebSocket);I hope this can help - and if not, I apologize in advance, I'm the new guy around these parts 😄 , and I can get help from someone more experienced with this project.
- addedbugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedproject:slack-api-clientproject:slack-api-clientproject:slack-api-clientand removed
on Jul 27, 2021 - changed the title
[-]How to set proxy for SocketModeApp?[/-][+]How to set proxy for SocketModeApp (JavaWebSocket)?[/+]on Aug 10, 2021 Hi @doncorsean, I tried to resolve this issue but I found that Java-WebSocket library does not support HTTP proxy with user / password as of today. Consider using Tyrus backend for now.
- changed the title
[-]How to set proxy for SocketModeApp (JavaWebSocket)?[/-][+]SocketModeApp (JavaWebSocket) does not support proxy with username:password[/+]on Aug 16, 2021 - addeddependenciesPull requests that update a dependency filePull requests that update a dependency fileand removedbugM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documentedM-T: confirmed bug report. Issues are confirmed when the reproduction steps are documented
on Aug 16, 2021 Thx for the guidance @seratch !
How do you configure proxy for Bolt Java SDK?
Able to set url using below but getting auth error
The Slack SDK version
[INFO] +- com.slack.api:bolt:jar:1.9.0:compile
[INFO] | +- com.slack.api:slack-api-model:jar:1.9.0:compile
[INFO] | +- com.slack.api:slack-api-client:jar:1.9.0:compile
[INFO] | - com.slack.api:slack-app-backend:jar:1.9.0:compile
[INFO] +- com.slack.api:bolt-servlet:jar:1.9.0:compile
[INFO] +- com.slack.api:bolt-jetty:jar:1.9.0:compile
[INFO] +- com.slack.api:bolt-socket-mode:jar:1.9.0:compile
Java Runtime version
java version "1.8.0_271"
Java(TM) SE Runtime Environment (build 1.8.0_271-b09)
Java HotSpot(TM) 64-Bit Server VM (build 25.271-b09, mixed mode)
OS info
ProductName: Mac OS X
ProductVersion: 10.15.7
BuildVersion: 19H1217
Darwin Kernel Version 19.6.0: Thu May 6 00:48:39 PDT 2021; root:xnu-6153.141.33~1/RELEASE_X86_64
Expected result:
Connected to slack API
Actual result:
Failed to call auth.test API (error: Failed to authenticate with proxy)
java.io.IOException: Failed to authenticate with proxy