T
T
tatarrr952020-06-11 21:46:03
Node.js
tatarrr95, 2020-06-11 21:46:03

How to set up a NodeJS Express server on my computer not with localhost IP?

I have an application that can only send web requests to port 80 or 443.
I want to raise a server that will accept requests from this application, but I cannot use the address 127.0.0.1:80. The application does not understand another port. Therefore, you need to raise a server that will be available only from my local machine, but not by ip 127.0.0.1 , but for example by some fictitious one. For example 192.168.0.100:80.
Like this. do?

I try like this:

http.createServer(app).listen(app.get('port'), '192.168.0.101', function () {
    console.log('Express server listening on port ' + app.get('port'));
});


But I get an error:
Error: listen EADDRNOTAVAIL: address not available 192.168.0.101:80

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rerurk, 2020-06-11
@Rerurk

Cmd
Ipconfig Shows the
local ip
Starts the node, log in to the browser via ip
Specify the http port in the node first

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question