Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixes default port

If host not present defaults to document.domain
  • Loading branch information...
commit a8290043b702a3091863eb26444e612664379e36 1 parent 5cebe02
@rauchg rauchg authored
Showing with 9 additions and 7 deletions.
  1. +2 −2 README.md
  2. +1 −1  lib/io.js
  3. +2 −1  lib/socket.js
  4. +4 −3 socket.io.js
View
4 README.md
@@ -51,9 +51,9 @@ Options:
- *port*
- 80
+ Current port or 80
- The port `socket.io` server is attached to
+ The port `socket.io` server is attached to (defaults to the document.location port)
- *resource*
View
2  lib/io.js
@@ -7,7 +7,7 @@
*/
this.io = {
- version: '0.1',
+ version: '0.1.1',
setPath: function(path){
this.path = path;
View
3  lib/socket.js
@@ -13,6 +13,7 @@ io.Socket = ioClass({
options: {
secure: false,
document: document,
+ port: document.location.port || 80,
resource: 'socket.io',
transports: ['websocket', 'server-events', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling'],
transportOptions: {},
@@ -20,7 +21,7 @@ io.Socket = ioClass({
},
init: function(host, options){
- this.host = host;
+ this.host = host || document.domain;
this.setOptions(options);
this.connected = false;
this.connecting = false;
View
7 socket.io.js
@@ -1,4 +1,4 @@
-/** Socket.IO 0.1 - Built with build.js */
+/** Socket.IO 0.1.1 - Built with build.js */
/**
* Socket.IO client
*
@@ -8,7 +8,7 @@
*/
this.io = {
- version: '0.1',
+ version: '0.1.1',
setPath: function(path){
this.path = path;
@@ -796,6 +796,7 @@ io.Socket = ioClass({
options: {
secure: false,
document: document,
+ port: document.location.port || 80,
resource: 'socket.io',
transports: ['websocket', 'server-events', 'flashsocket', 'htmlfile', 'xhr-multipart', 'xhr-polling'],
transportOptions: {},
@@ -803,7 +804,7 @@ io.Socket = ioClass({
},
init: function(host, options){
- this.host = host;
+ this.host = host || document.domain;
this.setOptions(options);
this.connected = false;
this.connecting = false;
Please sign in to comment.
Something went wrong with that request. Please try again.