Skip to content

Commit dff9cbf

Browse files
committed
1 parent 29a8fff commit dff9cbf

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

lib/manager.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -817,10 +817,15 @@ Manager.prototype.handleHandshake = function (data, req, res) {
817817
*/
818818

819819
Manager.prototype.handshakeData = function (data) {
820-
var connectionAddress = null;
821-
if (data.request.connection.address) {
822-
connectionAddress = data.request.connection.address();
820+
var connection = data.request.connection
821+
, connectionAddress;
822+
823+
if (connection.address) {
824+
connectionAddress = connection.address();
825+
} else if (connection.socket && connection.socket.address) {
826+
connectionAddress = connection.socket.address()
823827
}
828+
824829
return {
825830
headers: data.headers
826831
, address: connectionAddress
@@ -829,7 +834,6 @@ Manager.prototype.handshakeData = function (data) {
829834
, secure: data.request.connection.secure
830835
};
831836
};
832-
833837
/**
834838
* Verifies the origin of a request.
835839
*

0 commit comments

Comments
 (0)