How to change the folder where socket.io is fetching the socket.io.js JavaScript file?

Problem

The statement

<script src="/socket.io/socket.io.js"></script>

looks for socket.io.js in the 'public' folder instead of node_module.

Changing the url to ../node_module/socket.io/socket.io.js does not work.

How do I change the default folder which src looks into?

Problem courtesy of: Program_Sauce

Solution

socketio sever when receives the request '/socket.io/socket.io.js' , it dynamically builds the content ( considering the transports configured to be supported by the server ).

The file is neither served from public / node modules.

Solution courtesy of: Chandu

Discussion

There is currently no discussion for this recipe.

This recipe can be found in it's original form on Stack Over Flow.