Skip to content

Commit 3a6f869

Browse files
committed
chore: update documentation related to proxy authentication
The new API introduced in TBX 2.7, and HTTP proxy authentication works flawlessly. However, SOCKS5 proxy authentication does not appear to be properly supported in the current TBX implementation. While users can configure a SOCKS5 proxy with basic authentication, Toolbox fails to authenticate successfully. Coder uses OkHttp as the HTTP client, which in turn delegates SOCKS5 authentication to the JVM (java.net.SocksSocketImpl). We can configure a java.net .Authenticator with the credentials exposed by the new TBX API. However, since the Authenticator is set globally, doing so would affect all plugins — including TBX itself — which may not be desirable.
1 parent 6356b84 commit 3a6f869

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
### Added
66

7-
- support for basic proxy authentication
7+
- support for basic authentication for HTTP/HTTPS proxy
8+
- support for Toolbox 2.7 release
89

910
### Changed
1011

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ experience, it’s recommended to ensure the workspace is running prior to initi
110110
111111
## Configuring and Testing workspace polling with HTTP & SOCKS5 Proxy
112112

113-
This section explains how to set up a local proxy (without authentication which is not yet supported) and verify that
113+
This section explains how to set up a local proxy and verify that
114114
the plugin’s REST client works correctly when routed through it.
115115

116116
We’ll use [mitmproxy](https://mitmproxy.org/) for this — it can act as both an HTTP and SOCKS5 proxy with SSL
@@ -134,6 +134,12 @@ mitmproxy can do HTTP and SOCKS5 proxying. To configure one or the other:
134134
2. Navigate to `Options -> Edit Options`
135135
3. Update the `Mode` field to `regular` in order to activate HTTP/HTTPS or to `socks5`
136136
4. Proxy authentication can be enabled by updating the `proxyauth` to `username:password`
137+
5. Alternatively you can run the following commands:
138+
139+
```bash
140+
mitmweb --ssl-insecure --set stream_large_bodies="10m" --mode regular --proxyauth proxyUsername:proxyPassword
141+
mitmweb --ssl-insecure --set stream_large_bodies="10m" --mode socks5
142+
```
137143

138144
### Configure Proxy in Toolbox
139145

@@ -144,6 +150,10 @@ mitmproxy can do HTTP and SOCKS5 proxying. To configure one or the other:
144150
5. Before authenticating to the Coder deployment we need to tell the plugin where can we find mitmproxy
145151
certificates. In Coder's Settings page, set the `TLS CA path` to `~/.mitmproxy/mitmproxy-ca-cert.pem`
146152

153+
> ⚠️ Note: Coder Toolbox plugin handles only HTTP/HTTPS proxy authentication.
154+
> SOCKS5 proxy authentication is currently not supported due to limitations
155+
> described in: https://youtrack.jetbrains.com/issue/TBX-14532/Missing-proxy-authentication-settings#focus=Comments-27-12265861.0-0
156+
147157
## Debugging and Reporting issues
148158

149159
Enabling debug logging is essential for diagnosing issues with the Toolbox plugin, especially when SSH

src/main/kotlin/com/coder/toolbox/sdk/CoderRestClient.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ open class CoderRestClient(
8080
builder.proxySelector(context.proxySettings.getProxySelector()!!)
8181
}
8282

83+
// Note: This handles only HTTP/HTTPS proxy authentication.
84+
// SOCKS5 proxy authentication is currently not supported due to limitations described in:
85+
// https://youtrack.jetbrains.com/issue/TBX-14532/Missing-proxy-authentication-settings#focus=Comments-27-12265861.0-0
8386
builder.proxyAuthenticator { _, response ->
8487
val proxyAuth = context.proxySettings.getProxyAuth()
8588
if (proxyAuth == null || proxyAuth !is ProxyAuth.Basic) {

0 commit comments

Comments
 (0)