This commit is contained in:
Clemens Vasters 2016-09-23 16:07:39 +02:00
Родитель 56e2d8f832
Коммит 7cb3a782df
5 изменённых файлов: 18 добавлений и 10 удалений

Просмотреть файл

@ -125,7 +125,7 @@ replaced with the correct values for namespace, path, and token using a template
}
var host = window.document.location.host.replace(/:.*/, '');
var ws = new WebSocket('wss://{{ns}}:443/$servicebus/hybridconnection/{{path}}?'+
var ws = new WebSocket('wss://{{ns}}:443/$hc/{{path}}?'+
'sb-hc-action=connect&sb-hc-token={{token}}');
ws.onmessage = function (event) {
updateStats(JSON.parse(event.data));

Просмотреть файл

@ -18,7 +18,7 @@
}
var host = window.document.location.host.replace(/:.*/, '');
var ws = new WebSocket('wss://{{ns}}:443/$servicebus/hybridconnection/{{path}}?sb-hc-action=connect&sb-hc-token={{token}}');
var ws = new WebSocket('wss://{{ns}}:443/$hc/{{path}}?sb-hc-action=connect&sb-hc-token={{token}}');
ws.onmessage = function (event) {
updateStats(JSON.parse(event.data));
};

Просмотреть файл

@ -1,8 +1,16 @@
WebSocket Client & Server Implementation for Node
=================================================
# The 'hyco-websocket' Package for Azure Relay Hybrid Connections
Overview
--------
## Overview
This Node package for Azure Relay Hybrid Connections is built on and extends the
['websocket'](https://www.npmjs.com/package/websocket) NPM package. This package
re-exports all exports of that base package and adds new exports that enable
integration with the Azure Relay service's Hybrid Connections feature.
Existing applications that ```require('websocket')``` can use this package instead
with ```require('hyco-websocket')``` , which also enables hybrid scenarios where an
application can listen for WebSocket connections locally from "inside the firewall"
and via the Hybrid
Documentation

Просмотреть файл

@ -21,7 +21,7 @@ WS.createRelayToken = function createRelayToken(uri, key_name, key) {
WS.createRelaySendUri = function createRelaySendUri(serviceBusNamespace, path, token, id)
{
var uri = 'wss://' + serviceBusNamespace + ':443/$servicebus/hybridconnection/'+ path;
var uri = 'wss://' + serviceBusNamespace + ':443/$hc/'+ path;
uri = uri + ( uri.indexOf('?') == -1 ?'?':'&') + 'sb-hc-action=connect';
if ( token != null ) {
uri = uri + '&sb-hc-token=' + encodeURIComponent(token);
@ -34,7 +34,7 @@ WS.createRelaySendUri = function createRelaySendUri(serviceBusNamespace, path, t
WS.createRelayListenUri = function createRelayListenUri(serviceBusNamespace, path, token, id)
{
var uri = 'wss://' + serviceBusNamespace + ':443/$servicebus/hybridconnection/'+ path;
var uri = 'wss://' + serviceBusNamespace + ':443/$hc/'+ path;
uri = uri + ( uri.indexOf('?') == -1 ?'?':'&') + 'sb-hc-action=listen';
if ( token != null ) {
uri = uri + '&sb-hc-token=' + encodeURIComponent(token);

Просмотреть файл

@ -71,7 +71,7 @@ WS.createRelayToken = function createRelayToken(uri, key_name, key) {
WS.createRelaySendUri = function createRelaySendUri(serviceBusNamespace, path, token, id)
{
var uri = 'wss://' + serviceBusNamespace + ':443/$servicebus/hybridconnection/'+ path;
var uri = 'wss://' + serviceBusNamespace + ':443/$hc/'+ path;
uri = uri + ( uri.indexOf('?') == -1 ?'?':'&') + 'sb-hc-action=connect';
if ( token != null ) {
uri = uri + '&sb-hc-token=' + encodeURIComponent(token);
@ -84,7 +84,7 @@ WS.createRelaySendUri = function createRelaySendUri(serviceBusNamespace, path, t
WS.createRelayListenUri = function createRelayListenUri(serviceBusNamespace, path, token, id)
{
var uri = 'wss://' + serviceBusNamespace + ':443/$servicebus/hybridconnection/'+ path;
var uri = 'wss://' + serviceBusNamespace + ':443/$hc/'+ path;
uri = uri + ( uri.indexOf('?') == -1 ?'?':'&') + 'sb-hc-action=listen';
if ( token != null ) {
uri = uri + '&sb-hc-token=' + encodeURIComponent(token);