Skip to content

Commit

Permalink
Merge pull request SnapDrop#75 from JBYoshi/localhost
Browse files Browse the repository at this point in the history
Make IPv4 and IPv6 localhost connections use the same room.
  • Loading branch information
RobinLinus authored Feb 18, 2019
2 parents a3e751e + cd22188 commit c00ba60
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,10 @@ class Peer {
} else {
this.ip = request.connection.remoteAddress;
}
// IPv4 and IPv6 use different values to refer to localhost
if (this.ip == '::1' || this.ip == '::ffff:127.0.0.1') {
this.ip = '127.0.0.1';
}
}

_setPeerId(request) {
Expand Down

0 comments on commit c00ba60

Please sign in to comment.