Added accessor to transport handshake request

This commit is contained in:
Guillermo Rauch
2012-07-03 14:17:17 -07:00
parent f30f353a36
commit 73cf06cc34

View File

@@ -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.
*