Hi All,
Can you please tell me , how to configure verticle to accept Secure Websocket "wss" connection?
I am developing a app which will run on HTTPS, and app will make websocket calls to transmit some data. But as application will run on HTTPS, browser is not allowing to make ws connection , as its downgrade.
"The WebSocket connection starts its life with an HTTP or HTTPS handshake. When the page is accessed through HTTP, you can use WS or WSS (WebSocket secure: WS over TLS) . However, when your page is loaded through HTTPS, you can only use WSS - browsers don't allow to "downgrade" security."
My Server code is as given below, -
public class BridgeServer extends Verticle {
@Override
public void start() throws Exception {
HttpServer server = vertx.createHttpServer();
server.websocketHandler(new Handler<ServerWebSocket>() {
public void handle(final ServerWebSocket ws) {
ws.dataHandler(new Handler<Buffer>() {
public void handle(Buffer data) {
MeetingRoomController.getInstance().handleRequest(ws, data, vertx);
}
});
ws.endHandler(new Handler<Void>() {
@Override
public void handle(Void arg0) {
MeetingRoomController.getInstance().handleCloseConnectionRequest(ws, vertx);
}
});
}
}).requestHandler(new Handler<HttpServerRequest>() {
public void handle(HttpServerRequest req) {
}
}).listen(23456);
}
}
this server is ready to accept "ws" calls but not "wss" calls.
What I need to change in this code, so it will work ..
Thanks,
Swapnil