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:
Julien Viet
2019-05-15 11:06:42 +02:00
parent 5ae08e417b
commit abaa22609d
15 changed files with 1094 additions and 476 deletions

View File

@@ -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!");
}
});
}