mirror of
https://github.com/jlengrand/vert.x.git
synced 2026-04-04 00:41:23 +00:00
Implement HttpClient#webSocket(..., Handler<AsyncResult<WebSocket>>) methods as well as WebSocketConnectOptions to keep the overloading of the webSocket method reasonnable. In addition we also add headers support to RequestOptions so one can specify headers when create an HttpClientRequest or a WebSocket from options. Finally the previous HttpClient WebSocket connect methods are deprecated in favor of the new ones. This closes #2954, closes #2955, closes #2956, closes #2957
This commit is contained in:
@@ -712,8 +712,11 @@ public class HTTPExamples {
|
||||
}
|
||||
|
||||
public void example54(HttpClient client) {
|
||||
client.websocket("/some-uri", websocket -> {
|
||||
System.out.println("Connected!");
|
||||
client.webSocket("/some-uri", res -> {
|
||||
if (res.succeeded()) {
|
||||
WebSocket ws = res.result();
|
||||
System.out.println("Connected!");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user