mirror of https://github.com/calzoneman/sync.git
Reject sockets with no IP
This commit is contained in:
parent
50dd0982a4
commit
b4bcb7637b
|
@ -127,6 +127,13 @@ function addTypecheckedFunctions(sock) {
|
||||||
*/
|
*/
|
||||||
function handleConnection(sock) {
|
function handleConnection(sock) {
|
||||||
var ip = sock.request.connection.remoteAddress;
|
var ip = sock.request.connection.remoteAddress;
|
||||||
|
if (!ip) {
|
||||||
|
socket.emit("kick", {
|
||||||
|
reason: "Your IP address could not be determined from the socket connection. See https://github.com/Automattic/socket.io/issues/1387#issuecomment-48425088 for details"
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (net.isIPv6(ip)) {
|
if (net.isIPv6(ip)) {
|
||||||
ip = util.expandIPv6(ip);
|
ip = util.expandIPv6(ip);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue