mirror of
https://github.com/socketio/socket.io.git
synced 2026-04-30 03:00:39 -04:00
Added accessor to transport handshake request
This commit is contained in:
@@ -24,8 +24,6 @@ function Socket (id, server, transport) {
|
||||
this.readyState = 'opening';
|
||||
this.writeBuffer = [];
|
||||
|
||||
// keep track of request that originated the transport
|
||||
this.req = transport.req;
|
||||
this.setTransport(transport);
|
||||
this.onOpen();
|
||||
}
|
||||
@@ -36,6 +34,16 @@ function Socket (id, server, transport) {
|
||||
|
||||
Socket.prototype.__proto__ = EventEmitter.prototype;
|
||||
|
||||
/**
|
||||
* Accessor for request that originated socket.
|
||||
*
|
||||
* @api public
|
||||
*/
|
||||
|
||||
Socket.prototype.__defineGetter__('request', function () {
|
||||
return this.transport.request;
|
||||
});
|
||||
|
||||
/**
|
||||
* Called upon transport considered open.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user