For easy to develop I want connect to my socket.io server(Node.js) from html files on the local drive with out webserver. How to config it? Or best way for it?
Asked
Active
Viewed 313 times
0
-
this has already been asked and answered http://stackoverflow.com/questions/6084360/node-js-as-a-simple-web-server – Cadell Christo Jun 27 '12 at 09:54
-
that's not talk about socket.io...? – Phatsin.lk Jun 27 '12 at 11:08
1 Answers
0
Serving static files is not what socket.io is made for. Especially binary files is annoying with websockets.
Node.js has everything you need to serve static files, as Cadell pointed out there are good guides on the web for doing that.
The better solution IMHO is to use the connect framework for Node.js so you can use the static middleware. If you want to make your life even easier IMHO, then I'd use the express framework which is built on top of connect and includes a lot of really nice things to make writing a web app simpler. It's very easy to serve static files via either of those solutions.

smathy
- 26,283
- 5
- 48
- 68
-
Now i use socket.io+porthole(https://github.com/ternarylabs/porthole) i'am very happy for it.Thank you.^_^ – Phatsin.lk Jun 29 '12 at 09:24