Client#conn, Socket#conn is an instance of engine.Socket, including properties "request" and "upgraded".

https://github.com/socketio/socket.io/blob/master/docs/API.md#socketconn
https://github.com/socketio/socket.io/blob/master/docs/API.md#clientconn

https://github.com/socketio/engine.io#properties-2
This commit is contained in:
武田 憲太郎
2017-03-13 19:58:40 +09:00
parent 58fb00ab11
commit f133fc0c1e
+42 -44
View File
@@ -509,28 +509,7 @@ declare namespace SocketIO {
/**
* The underlying Engine.io Socket instance
*/
conn: {
/**
* The ID for this socket - matches Client.id
*/
id: string;
/**
* The Engine.io Server for this socket
*/
server: any;
/**
* The ready state for the client. Either 'opening', 'open', 'closing', or 'closed'
*/
readyState: string;
/**
* The remote IP for this connection
*/
remoteAddress: string;
};
conn: EngineSocket;
/**
* The list of rooms that this Socket is currently in, where
@@ -751,28 +730,7 @@ declare namespace SocketIO {
/**
* The underlying Engine.io Socket instance
*/
conn: {
/**
* The ID for this socket - matches Client.id
*/
id: string;
/**
* The Engine.io Server for this socket
*/
server: any;
/**
* The ready state for the client. Either 'opening', 'open', 'closing', or 'closed'
*/
readyState: string;
/**
* The remote IP for this connection
*/
remoteAddress: string;
};
conn: EngineSocket;
/**
* The ID for this client. Regenerated at every connection
@@ -797,4 +755,44 @@ declare namespace SocketIO {
*/
nsps: {[nsp: string]: Socket};
}
/**
* A reference to the underlying engine.io Socket connection.
*/
interface EngineSocket extends NodeJS.EventEmitter {
/**
* The ID for this socket - matches Client.id
*/
id: string;
/**
* The Engine.io Server for this socket
*/
server: any;
/**
* The ready state for the client. Either 'opening', 'open', 'closing', or 'closed'
*/
readyState: string;
/**
* The remote IP for this connection
*/
remoteAddress: string;
/**
* whether the transport has been upgraded
*/
upgraded: boolean;
/**
* (http.IncomingMessage): request that originated the Socket
*/
request: any;
/**
* (Transport): transport reference
*/
transport: any;
}
}