Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
194 additions
and
366 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,12 @@ | ||
import java.net.InetSocketAddress; | ||
import java.net.Proxy; | ||
import java.net.URI; | ||
import java.net.URISyntaxException; | ||
import java.nio.channels.ByteChannel; | ||
|
||
public class ProxyClientExample extends ExampleClient { | ||
|
||
public ProxyClientExample( URI serverURI , InetSocketAddress proxy ) { | ||
super( serverURI ); | ||
setProxy( proxy ); | ||
} | ||
|
||
@Override | ||
public ByteChannel createProxyChannel( ByteChannel towrap ) { | ||
/* | ||
* You can create custom proxy handshake here. | ||
* For more infos see: WebSocketClient.DefaultClientProxyChannel and http://tools.ietf.org/html/rfc6455#section-4.1 | ||
*/ | ||
return super.createProxyChannel( towrap ); | ||
} | ||
|
||
public class ProxyClientExample { | ||
public static void main( String[] args ) throws URISyntaxException { | ||
ProxyClientExample c = new ProxyClientExample( new URI( "ws://echo.websocket.org" ), new InetSocketAddress( "proxyaddress", 80 ) );// don't forget to change "proxyaddress" | ||
ExampleClient c = new ExampleClient( new URI( "ws://echo.websocket.org" ) ); | ||
c.setProxy( new Proxy( Proxy.Type.HTTP, new InetSocketAddress( "proxyaddress", 80 ) ) ); | ||
c.connect(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 0 additions & 52 deletions
52
src/main/java/org/java_websocket/client/DefaultSSLWebSocketClientFactory.java
This file was deleted.
Oops, something went wrong.
39 changes: 0 additions & 39 deletions
39
src/main/java/org/java_websocket/client/DefaultWebSocketClientFactory.java
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.