mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Fixed #188 and fixed a bug where secure wasn't correctly set
This commit is contained in:
@@ -161,7 +161,7 @@
|
||||
if (forceNew || !io.sockets[uuri]) {
|
||||
socket = new io.Socket({
|
||||
host: uri.host
|
||||
, secure: uri.protocol == 'https://'
|
||||
, secure: uri.protocol == 'https'
|
||||
, port: uri.port || 80
|
||||
});
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@
|
||||
this.options = {
|
||||
port: 80
|
||||
, secure: false
|
||||
, host: document ? document.domain : false
|
||||
, document: document
|
||||
, resource: 'socket.io'
|
||||
, transports: io.transports
|
||||
@@ -107,7 +108,8 @@
|
||||
function empty () { };
|
||||
|
||||
Socket.prototype.handshake = function (fn) {
|
||||
var self = this;
|
||||
var self = this
|
||||
, options = this.options;
|
||||
|
||||
function complete (data) {
|
||||
if (data instanceof Error) {
|
||||
@@ -117,7 +119,12 @@
|
||||
}
|
||||
};
|
||||
|
||||
var url = this.options.resource + '/' + io.protocol + '/?t=' + (+ new Date);
|
||||
var url = [
|
||||
'http' + (options.secure ? 's' : '' ) + '://' + options.host + ':' + options.port
|
||||
, this.options.resource
|
||||
, io.protocol
|
||||
, '?t=' + + new Date
|
||||
].join('/');
|
||||
|
||||
if (this.isXDomain()) {
|
||||
var insertAt = document.getElementsByTagName('script')[0]
|
||||
|
||||
Reference in New Issue
Block a user