Why node.js requires an upgrade while trying to run an application on the localhost?

前端 未结 4 733
梦毁少年i
梦毁少年i 2020-12-20 11:53

When I try to run my node.js application on a localhost server, it does not run and demands a required upgrade. I have tried to run the code but I get the following error:

4条回答
  •  伪装坚强ぢ
    2020-12-20 12:31

    Do not open a client HTML file as a localhost URL but open the file directly.

    After running your web-socket server,

    localhost:[port]/client.html -> you will get the message "upgrade required".

    file:///[folder]/client.html -> you can see your HTML file.

    because you don't have any web-server with a web-socket or you did not configure your web server for your web-socket. So, you should use your file system.

    The easiest way is to use right click on the client file and open it with your favorite browser.

提交回复
热议问题