Skip to content

Commit

Permalink
dgram: don't use localhost as addr on win32
Browse files Browse the repository at this point in the history
Resolves a relay connectivity issue
  • Loading branch information
mribbons committed Apr 17, 2023
1 parent d3b52c8 commit e4cb76d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions api/dgram.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import console from './console.js'
import ipc from './ipc.js'
import dns from './dns.js'
import gc from './gc.js'
import os from './os.js'

import * as exports from './dgram.js'

Expand Down Expand Up @@ -114,9 +113,7 @@ function fromBufferList (list) {

function getDefaultAddress (socket) {
if (socket.type === 'udp6') return '::1'
if (socket.type === 'udp4') {
return os.platform() === 'win32' ? '127.0.0.1' : '0.0.0.0'
}
if (socket.type === 'udp4') return '0.0.0.0'

return null
}
Expand Down

0 comments on commit e4cb76d

Please sign in to comment.