Permalink
Browse files

Fixes default port

If host not present defaults to document.domain
  • Loading branch information...
1 parent 5cebe02 commit a8290043b702a3091863eb26444e612664379e36 @rauchg rauchg committed Mar 28, 2010
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
@@ -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
@@ -7,7 +7,7 @@
*/
this.io = {
- version: '0.1',
+ version: '0.1.1',
setPath: function(path){
this.path = path;
View
@@ -13,14 +13,15 @@ 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: {},
rememberTransport: true
},
init: function(host, options){
- this.host = host;
+ this.host = host || document.domain;
this.setOptions(options);
this.connected = false;
this.connecting = false;
View
@@ -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,14 +796,15 @@ 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: {},
rememberTransport: true
},
init: function(host, options){
- this.host = host;
+ this.host = host || document.domain;
this.setOptions(options);
this.connected = false;
this.connecting = false;

0 comments on commit a829004

Please sign in to comment.