Closed baklanovavpulter closed 6 years ago
$ ws Serving at http://mbp.local:8000, http://127.0.0.1:8000, http://192.168.0.100:8000
req-then
package (like in lws-rewrite
). I just intrested is there some built-in methods or not.$ node
> const util = require('lws/lib/util')
> util.getIPList()
[ { address: 'mbp.local' },
{ address: '127.0.0.1',
netmask: '255.0.0.0',
family: 'IPv4',
mac: '00:00:00:00:00:00',
internal: true,
cidr: '127.0.0.1/8' },
{ address: '192.168.0.103',
netmask: '255.255.255.0',
family: 'IPv4',
mac: 'd0:a6:37:e9:86:49',
internal: false,
cidr: '192.168.0.103/24' } ]
What if some reasons, lws cannot bind to '127.0.0.1' but can on all other? I suppose, lws started with startup message:
$ ws Serving at http://mbp.local:8000, http://192.168.0.103:8000
but util.getIPList()
returns me
[ { address: 'mbp.local' },
{ address: '127.0.0.1',
netmask: '255.0.0.0',
family: 'IPv4',
mac: '00:00:00:00:00:00',
internal: true,
cidr: '127.0.0.1/8' },
{ address: '192.168.0.103',
netmask: '255.255.255.0',
family: 'IPv4',
mac: 'd0:a6:37:e9:86:49',
internal: false,
cidr: '192.168.0.103/24' } ]
Or this cannot be happen?
This is question.
I'm trying to write my own middleware to provide transparent proxy service.
ctx
object is still refers to some local file? I can get current serving port fromoptions
object that passed tomiddleware
method, but I need also list of current binded host/ip. Can I have access to current serving list?