0

With a webpage hosted locally on my system, with socket.io installed, this page can be served with socket.io.js attached:

<!doctype html>
<html>
<head>
<title>SkyOS</title>
<script src="/socket.io/socket.io.js"></script>
</head>
<body>
</body>
</html>

But if I want to serve this webpage from a webhost like GoDaddy, that file isn't going to be on the directory through installation.

So, that's simple. Just upload socket.io.js onto the webhost. Except one issue:

I can't find socket.io.js anywhere on the web.

So, according to the answer to this question, I shoudln't ever do that. Am I missing something here? Is socket.io not a normal javascript library like any other?

Community
  • 1
  • 1
  • 1
    It says on the answer to that question that the js file is served by the socket.io server. – Robert Harvey Mar 15 '14 at 23:32
  • My question was "Why?" Why does the Socket.io server need to host that file? @RobertHarvey –  Mar 15 '14 at 23:38
  • Probably because it changes due to configuration settings or some other reason. – Robert Harvey Mar 15 '14 at 23:48
  • @RobertHarvey Yes, and I found the source of my confusion here http://stackoverflow.com/questions/16939755/socket-io-gives-welcome-to-socket-io-message –  Mar 15 '14 at 23:56

1 Answers1

0

The socket.io server has got the proper client library available and will serve it from the /socket.io/socket.io.js file (depending on your settings the exact contents may vary).

In case you are not using your socket.io server as the general HTTP server simply prepend the proper host.

TimWolla
  • 31,849
  • 8
  • 63
  • 96