Skip to content

Commit 1d1f35f

Browse files
committed
v15.1.0
1 parent ace92cc commit 1d1f35f

File tree

4 files changed

+30
-17
lines changed

4 files changed

+30
-17
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
const AGClientSocket = require('./lib/clientsocket');
22
const factory = require('./lib/factory');
3-
const version = '15.0.2';
3+
const version = '15.1.0';
44

55
module.exports.factory = factory;
66
module.exports.AGClientSocket = AGClientSocket;

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "socketcluster-client",
33
"description": "SocketCluster JavaScript client",
4-
"version": "15.0.3",
4+
"version": "15.1.0",
55
"homepage": "https://socketcluster.io/",
66
"contributors": [
77
{

socketcluster-client.js

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* SocketCluster JavaScript client v15.0.2
2+
* SocketCluster JavaScript client v15.1.0
33
*/
44
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.socketClusterClient = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
55
(function (global){
@@ -90,6 +90,8 @@ function AGClientSocket(socketOptions) {
9090
let defaultOptions = {
9191
path: '/socketcluster/',
9292
secure: false,
93+
protocolScheme: null,
94+
socketPath: null,
9395
autoConnect: true,
9496
autoReconnect: true,
9597
autoSubscribeOnConnect: true,
@@ -1747,7 +1749,12 @@ AGTransport.CLOSED = AGTransport.prototype.CLOSED = 'closed';
17471749

17481750
AGTransport.prototype.uri = function () {
17491751
let query = this.options.query || {};
1750-
let schema = this.options.secure ? 'wss' : 'ws';
1752+
let scheme;
1753+
if (this.options.protocolScheme == null) {
1754+
scheme = this.options.secure ? 'wss' : 'ws';
1755+
} else {
1756+
scheme = this.options.protocolScheme;
1757+
}
17511758

17521759
if (this.options.timestampRequests) {
17531760
query[this.options.timestampParam] = (new Date()).getTime();
@@ -1760,19 +1767,25 @@ AGTransport.prototype.uri = function () {
17601767
}
17611768

17621769
let host;
1763-
if (this.options.host) {
1764-
host = this.options.host;
1765-
} else {
1766-
let port = '';
1770+
let path;
1771+
if (this.options.socketPath == null) {
1772+
if (this.options.host) {
1773+
host = this.options.host;
1774+
} else {
1775+
let port = '';
17671776

1768-
if (this.options.port && ((schema === 'wss' && this.options.port !== 443)
1769-
|| (schema === 'ws' && this.options.port !== 80))) {
1770-
port = ':' + this.options.port;
1777+
if (this.options.port && ((scheme === 'wss' && this.options.port !== 443)
1778+
|| (scheme === 'ws' && this.options.port !== 80))) {
1779+
port = ':' + this.options.port;
1780+
}
1781+
host = this.options.hostname + port;
17711782
}
1772-
host = this.options.hostname + port;
1783+
path = this.options.path;
1784+
} else {
1785+
host = this.options.socketPath;
1786+
path = `:${this.options.path}`;
17731787
}
1774-
1775-
return schema + '://' + host + this.options.path + query;
1788+
return scheme + '://' + host + path + query;
17761789
};
17771790

17781791
AGTransport.prototype._onOpen = async function () {
@@ -6629,7 +6642,7 @@ module.exports = WritableConsumableStream;
66296642
},{"./consumer":34,"consumable-stream":13}],"socketcluster-client":[function(require,module,exports){
66306643
const AGClientSocket = require('./lib/clientsocket');
66316644
const factory = require('./lib/factory');
6632-
const version = '15.0.2';
6645+
const version = '15.1.0';
66336646

66346647
module.exports.factory = factory;
66356648
module.exports.AGClientSocket = AGClientSocket;

socketcluster-client.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)