search

Home  >  Q&A  >  body text

node.js - server port 80 problem

Use node.js to create a service locally to listen to port 80. I visit it in the browser, for example: www.baidu.com
Req.headers cannot be logged in node.js. And accessing 127.0.0.1 will get the headers.
Is the service local and must be accessed locally? Visiting www.baidu.com is accessing Baidu's server. But they are all through port 80. I don’t know why it works? (Ask God for guidance.)

黄舟黄舟2831 days ago587

reply all(1)I'll reply

  • 怪我咯

    怪我咯2017-05-16 13:37:47

    When you access Baidu’s port 80, this port 80 belongs to the other party. The local machine is assigned a dynamic port to connect to.

    The locally open port 80 is to monitor the connections of "others". When others access your IP (of course, including your own reflective IP [::1]), it is your port 80 that is connected

    reply
    0
  • Cancelreply