Java Examples for com.google.firebase.database.tubesock.WebSocket

The following java examples will help you to understand the usage of com.google.firebase.database.tubesock.WebSocket. These source code samples are taken from different open source projects.

Example 1
Project: firebase-admin-java-master  File: WebsocketConnection.java View source code
private WSClient createConnection(HostInfo hostInfo, String optCachedHost, String optLastSessionId) {
    String host = (optCachedHost != null) ? optCachedHost : hostInfo.getHost();
    URI uri = HostInfo.getConnectionUrl(host, hostInfo.isSecure(), hostInfo.getNamespace(), optLastSessionId);
    Map<String, String> extraHeaders = new HashMap<>();
    extraHeaders.put("User-Agent", this.connectionContext.getUserAgent());
    WebSocket ws = new WebSocket(uri, /*protocol=*/
    null, extraHeaders);
    WSClientTubesock client = new WSClientTubesock(ws);
    return client;
}