@@ -54,7 +54,7 @@ Each connector is published as a separate maven dependency. For example:
5454<dependency >
5555 <groupId >io.github.binance</groupId >
5656 <artifactId >binance-spot</artifactId >
57- <version >1.1 .0</version >
57+ <version >1.2 .0</version >
5858</dependency >
5959```
6060
@@ -148,6 +148,17 @@ When creating WebSocket API clients (such as SpotWebSocketApi), you can follow:
148148 Proxy proxy = new Proxy (Proxy . Type . HTTP , new InetSocketAddress (" host" , 123 ));
149149 // Add the proxy to the configuration
150150 clientConfiguration. setProxy(proxy);
151+ // Create the Proxy Authenticator
152+ Authenticator proxyAuthenticator = new Authenticator () {
153+ @Override public Request authenticate (Route route , Response response ) throws IOException {
154+ String credential = Credentials . basic(" username" , " password" );
155+ return response. request(). newBuilder()
156+ .header(" Proxy-Authorization" , credential)
157+ .build();
158+ }
159+ };
160+ // Add the proxy authenticator to the configuration
161+ clientConfiguration. setProxyAuthenticator(proxyAuthenticator);
151162 // Use with API
152163 SpotRestApi spotRestApi = new SpotRestApi (clientConfiguration);
153164```
@@ -159,7 +170,16 @@ When creating WebSocket API clients (such as SpotWebSocketApi), you can follow:
159170 // Create the HTTP proxy
160171 HttpProxy proxy = new HttpProxy (" host" , 123 );
161172 // Add the proxy to the configuration
162- clientConfiguration. setProxy(proxy);
173+ clientConfiguration. setWebSocketProxy(proxy);
174+ // Create the Proxy Authentication
175+ BasicAuthentication basicAuthentication = new BasicAuthentication (
176+ URI . create(" http://host:123" ),
177+ Authentication . ANY_REALM ,
178+ " username" ,
179+ " password"
180+ );
181+ // Add the Proxy Authentication to the configuration
182+ clientConfiguration. setWebSocketProxyAuthentication(basicAuthentication);
163183 // Use with API
164184 SpotWebSocketApi spotWebSocketApi = new SpotWebSocketApi (clientConfiguration);
165185```
@@ -171,9 +191,18 @@ When creating WebSocket API clients (such as SpotWebSocketApi), you can follow:
171191 // Create the HTTP proxy
172192 HttpProxy proxy = new HttpProxy (" host" , 123 );
173193 // Add the proxy to the configuration
174- clientConfiguration. setProxy(proxy);
194+ clientConfiguration. setWebSocketProxy(proxy);
195+ // Create the Proxy Authentication
196+ BasicAuthentication basicAuthentication = new BasicAuthentication (
197+ URI . create(" http://host:123" ),
198+ Authentication . ANY_REALM ,
199+ " username" ,
200+ " password"
201+ );
202+ // Add the Proxy Authentication to the configuration
203+ clientConfiguration. setWebSocketProxyAuthentication(basicAuthentication);
175204 // Use with API
176- SpotWebSocketStreams spotWebSocketApi = new SpotWebSocketStreams (clientConfiguration);
205+ SpotWebSocketApi spotWebSocketApi = new SpotWebSocketApi (clientConfiguration);
177206```
178207
179208
0 commit comments