Skip to content

Commit 79c2a10

Browse files
committed
SOCKS5 Proxy example
1 parent 9d2cd3c commit 79c2a10

File tree

1 file changed

+62
-49
lines changed

1 file changed

+62
-49
lines changed

README.md

Lines changed: 62 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -135,26 +135,26 @@ See:
135135
136136
### Usage example
137137
138-
build/kafka-proxy server --bootstrap-server-mapping "192.168.99.100:32400,0.0.0.0:32399"
138+
kafka-proxy server --bootstrap-server-mapping "192.168.99.100:32400,0.0.0.0:32399"
139139
140-
build/kafka-proxy server --bootstrap-server-mapping "192.168.99.100:32400,127.0.0.1:32400" \
141-
--bootstrap-server-mapping "192.168.99.100:32401,127.0.0.1:32401" \
142-
--bootstrap-server-mapping "192.168.99.100:32402,127.0.0.1:32402" \
143-
--dynamic-listeners-disable
144-
145-
build/kafka-proxy server --bootstrap-server-mapping "kafka-0.example.com:9092,0.0.0.0:32401,kafka-0.grepplabs.com:9092" \
146-
--bootstrap-server-mapping "kafka-1.example.com:9092,0.0.0.0:32402,kafka-1.grepplabs.com:9092" \
147-
--bootstrap-server-mapping "kafka-2.example.com:9092,0.0.0.0:32403,kafka-2.grepplabs.com:9092" \
148-
--dynamic-listeners-disable
149-
150-
build/kafka-proxy server --bootstrap-server-mapping "192.168.99.100:32400,127.0.0.1:32400" \
151-
--external-server-mapping "192.168.99.100:32401,127.0.0.1:32402" \
152-
--external-server-mapping "192.168.99.100:32402,127.0.0.1:32403" \
153-
--forbidden-api-keys 20
140+
kafka-proxy server --bootstrap-server-mapping "192.168.99.100:32400,127.0.0.1:32400" \
141+
--bootstrap-server-mapping "192.168.99.100:32401,127.0.0.1:32401" \
142+
--bootstrap-server-mapping "192.168.99.100:32402,127.0.0.1:32402" \
143+
--dynamic-listeners-disable
144+
145+
kafka-proxy server --bootstrap-server-mapping "kafka-0.example.com:9092,0.0.0.0:32401,kafka-0.grepplabs.com:9092" \
146+
--bootstrap-server-mapping "kafka-1.example.com:9092,0.0.0.0:32402,kafka-1.grepplabs.com:9092" \
147+
--bootstrap-server-mapping "kafka-2.example.com:9092,0.0.0.0:32403,kafka-2.grepplabs.com:9092" \
148+
--dynamic-listeners-disable
149+
150+
kafka-proxy server --bootstrap-server-mapping "192.168.99.100:32400,127.0.0.1:32400" \
151+
--external-server-mapping "192.168.99.100:32401,127.0.0.1:32402" \
152+
--external-server-mapping "192.168.99.100:32402,127.0.0.1:32403" \
153+
--forbidden-api-keys 20
154154
155-
build/kafka-proxy server --bootstrap-server-mapping "kafka-0.grepplabs.com:9093,0.0.0.0:32399" \
156-
--tls-enable --tls-insecure-skip-verify \
157-
--sasl-enable --sasl-username myuser --sasl-password mysecret
155+
kafka-proxy server --bootstrap-server-mapping "kafka-0.grepplabs.com:9093,0.0.0.0:32399" \
156+
--tls-enable --tls-insecure-skip-verify \
157+
--sasl-enable --sasl-username myuser --sasl-password mysecret
158158
159159
### Proxy authentication example
160160
@@ -179,37 +179,50 @@ See:
179179
180180
Authentication between Kafka Proxy Client and Kafka Proxy Server with Google-ID (service account JWT)
181181
182-
build/kafka-proxy server --bootstrap-server-mapping "kafka-0.grepplabs.com:9092,127.0.0.1:32500" \
183-
--bootstrap-server-mapping "kafka-1.grepplabs.com:9092,127.0.0.1:32501" \
184-
--bootstrap-server-mapping "kafka-2.grepplabs.com:9092,127.0.0.1:32502" \
185-
--dynamic-listeners-disable \
186-
--http-disable \
187-
--proxy-listener-tls-enable \
188-
--proxy-listener-cert-file=/var/run/secret/server.cert.pem \
189-
--proxy-listener-key-file=/var/run/secret/server.key.pem \
190-
--auth-gateway-server-enable \
191-
--auth-gateway-server-method google-id \
192-
--auth-gateway-server-magic 3285573610483682037 \
193-
--auth-gateway-server-command google-id-info \
194-
--auth-gateway-server-param "--timeout=10" \
195-
--auth-gateway-server-param "--audience=tcp://kafka-gateway.grepplabs.com" \
196-
--auth-gateway-server-param "--email-regex=^[email protected]$"
197-
198-
build/kafka-proxy server --bootstrap-server-mapping "127.0.0.1:32500,127.0.0.1:32400" \
199-
--bootstrap-server-mapping "127.0.0.1:32501,127.0.0.1:32401" \
200-
--bootstrap-server-mapping "127.0.0.1:32502,127.0.0.1:32402" \
201-
--dynamic-listeners-disable \
202-
--http-disable \
203-
--tls-enable \
204-
--tls-ca-chain-cert-file /var/run/secret/client/ca-chain.cert.pem \
205-
--auth-gateway-client-enable \
206-
--auth-gateway-client-method google-id \
207-
--auth-gateway-client-magic 3285573610483682037 \
208-
--auth-gateway-client-command google-id-provider \
209-
--auth-gateway-client-param "--credentials-file=/var/run/secret/client/service-account.json" \
210-
--auth-gateway-client-param "--target-audience=tcp://kafka-gateway.grepplabs.com" \
211-
--auth-gateway-client-param "--timeout=10"
212-
182+
kafka-proxy server --bootstrap-server-mapping "kafka-0.grepplabs.com:9092,127.0.0.1:32500" \
183+
--bootstrap-server-mapping "kafka-1.grepplabs.com:9092,127.0.0.1:32501" \
184+
--bootstrap-server-mapping "kafka-2.grepplabs.com:9092,127.0.0.1:32502" \
185+
--dynamic-listeners-disable \
186+
--http-disable \
187+
--proxy-listener-tls-enable \
188+
--proxy-listener-cert-file=/var/run/secret/server.cert.pem \
189+
--proxy-listener-key-file=/var/run/secret/server.key.pem \
190+
--auth-gateway-server-enable \
191+
--auth-gateway-server-method google-id \
192+
--auth-gateway-server-magic 3285573610483682037 \
193+
--auth-gateway-server-command google-id-info \
194+
--auth-gateway-server-param "--timeout=10" \
195+
--auth-gateway-server-param "--audience=tcp://kafka-gateway.grepplabs.com" \
196+
--auth-gateway-server-param "--email-regex=^[email protected]$"
197+
198+
kafka-proxy server --bootstrap-server-mapping "127.0.0.1:32500,127.0.0.1:32400" \
199+
--bootstrap-server-mapping "127.0.0.1:32501,127.0.0.1:32401" \
200+
--bootstrap-server-mapping "127.0.0.1:32502,127.0.0.1:32402" \
201+
--dynamic-listeners-disable \
202+
--http-disable \
203+
--tls-enable \
204+
--tls-ca-chain-cert-file /var/run/secret/client/ca-chain.cert.pem \
205+
--auth-gateway-client-enable \
206+
--auth-gateway-client-method google-id \
207+
--auth-gateway-client-magic 3285573610483682037 \
208+
--auth-gateway-client-command google-id-provider \
209+
--auth-gateway-client-param "--credentials-file=/var/run/secret/client/service-account.json" \
210+
--auth-gateway-client-param "--target-audience=tcp://kafka-gateway.grepplabs.com" \
211+
--auth-gateway-client-param "--timeout=10"
212+
213+
### Connect to Kafka through SOCKS5 Proxy example
214+
215+
kafka-proxy server --bootstrap-server-mapping "kafka-0.grepplabs.com:9092,127.0.0.1:32500" \
216+
--bootstrap-server-mapping "kafka-1.grepplabs.com:9092,127.0.0.1:32501" \
217+
--bootstrap-server-mapping "kafka-2.grepplabs.com:9092,127.0.0.1:32502"
218+
--socks5-address localhost:1080
219+
220+
kafka-proxy server --bootstrap-server-mapping "kafka-0.grepplabs.com:9092,127.0.0.1:32500" \
221+
--bootstrap-server-mapping "kafka-1.grepplabs.com:9092,127.0.0.1:32501" \
222+
--bootstrap-server-mapping "kafka-2.grepplabs.com:9092,127.0.0.1:32502" \
223+
--socks5-address localhost:1080 \
224+
--socks5-username my-proxy-user \
225+
--socks5-password my-proxy-password
213226
214227
### Kubernetes sidecar container example
215228

0 commit comments

Comments
 (0)