11/**
2- * SocketCluster JavaScript client v10.1.2
2+ * SocketCluster JavaScript client v11.0.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 . socketCluster = f ( ) } } ) ( function ( ) { var define , module , exports ; return ( function ( ) { function e ( t , n , r ) { function s ( o , u ) { if ( ! n [ o ] ) { if ( ! t [ o ] ) { var a = typeof require == "function" && require ; if ( ! u && a ) return a ( o , ! 0 ) ; if ( i ) return i ( o , ! 0 ) ; var f = new Error ( "Cannot find module '" + o + "'" ) ; throw f . code = "MODULE_NOT_FOUND" , f } var l = n [ o ] = { exports :{ } } ; t [ o ] [ 0 ] . call ( l . exports , function ( e ) { var n = t [ o ] [ 1 ] [ e ] ; return s ( n ?n :e ) } , l , l . exports , e , t , n , r ) } return n [ o ] . exports } var i = typeof require == "function" && require ; for ( var o = 0 ; o < r . length ; o ++ ) s ( r [ o ] ) ; return s } return e } ) ( ) ( { 1 :[ function ( _dereq_ , module , exports ) {
55var SCSocket = _dereq_ ( './lib/scsocket' ) ;
@@ -22,7 +22,7 @@ module.exports.destroy = function (options) {
2222
2323module . exports . clients = SCSocketCreator . clients ;
2424
25- module . exports . version = '10.1.2 ' ;
25+ module . exports . version = '11.0.0 ' ;
2626
2727} , { "./lib/scsocket" :4 , "./lib/scsocketcreator" :5 , "component-emitter" :12 } ] , 2 :[ function ( _dereq_ , module , exports ) {
2828( function ( global ) {
@@ -1218,17 +1218,28 @@ function create(options) {
12181218
12191219 options = options || { } ;
12201220
1221+ if ( options . host && ! options . host . match ( / [ ^ : ] + : \d { 2 , 5 } / ) ) {
1222+ throw new InvalidArgumentsError ( 'The host option should include both' +
1223+ ' the hostname and the port number in the format "hostname:port"' ) ;
1224+ }
1225+
1226+ if ( options . host && options . hostname ) {
1227+ throw new InvalidArgumentsError ( 'The host option should already include' +
1228+ ' the hostname and the port number in the format "hostname:port"' +
1229+ ' - Because of this, you should never use host and hostname options together' ) ;
1230+ }
1231+
12211232 if ( options . host && options . port ) {
1222- throw new InvalidArgumentsError ( 'The host option should already include the ' +
1223- ' port number in the format hostname:port - Because of this, the host and port options ' +
1224- ' cannot be specified together; use the hostname option instead ' ) ;
1233+ throw new InvalidArgumentsError ( 'The host option should already include' +
1234+ ' the hostname and the port number in the format " hostname:port" ' +
1235+ ' - Because of this, you should never use host and port options together ' ) ;
12251236 }
12261237
12271238 var isSecureDefault = isUrlSecure ( ) ;
12281239
12291240 var opts = {
12301241 port : getPort ( options , isSecureDefault ) ,
1231- hostname : global . location && location . hostname ,
1242+ hostname : global . location && location . hostname || 'localhost' ,
12321243 path : '/socketcluster/' ,
12331244 secure : isSecureDefault ,
12341245 autoConnect : true ,
0 commit comments