the URI scheme in rfc6455
* modified returned location header entry on get stream to use "ws" protocol
Change-Id: I0b7a6e572a917545371276f09c5949e9b66e4e73
Signed-off-by: Jan Hajnar <[email protected]>
} catch (NullPointerException e) {
WebSocketServer.createInstance(NOTIFICATION_PORT);
}
- UriBuilder port = uriBuilder.port(notificationPort);
- final URI uriToWebsocketServer = port.replacePath(streamName).build();
+ final UriBuilder uriToWebsocketServerBuilder = uriBuilder.port(notificationPort).scheme("ws");
+ final URI uriToWebsocketServer = uriToWebsocketServerBuilder.replacePath(streamName).build();
return Response.status(Status.OK).location(uriToWebsocketServer).build();
}
* @return String representation of web socket location.
*/
private static String getWebSocketLocation(final HttpRequest req) {
- return "http://" + req.headers().get(HOST) + req.getUri();
+ return "ws://" + req.headers().get(HOST) + req.getUri();
}
}