My target: Create node.js server and client applications that will send antyhing (event, string, function call) between two web browsers.
I installed and created simple server, but problems begin with creating a client. As said at http://socket.io/ I installed it by command:
npm install socket.io
but the file required in basic example:
<script src="/socket.io/socket.io.js"></script>
is not downloaded or installed. There is file named like that in /node_modules/socket.id/lib
but is the same file ? I think that this is socket.io client but as module for server, not for web browser javascript right ?
How to get socket.io.js
that just works and can connect to node.js server, without errors like io/socket/require is not defined etc. ?
I don't want to create web serwer that responds to normal http requests. I want server that will hold connection and able to communicate between JS scripts in two browsers
I just can stand it, that everybody writes about node.js in form like everybody on the world has socket.io.js file in every possible direcortory. The possible duplicate:
Starts with a function call require()
that IS NOT in clean JavaScript API. So i don't even try this sollution. Can anybody explain how to include and define io.* properly ? It is something about Express framework ? Why node.js and socket.id pages say nothing about express requirement ?
The problem is, that I need a CLIENT js library, and I don't mean "client on server", that my node binary server will have ability to connect to other pages/server and communicate. I mean client in HTML client page. And, if neccessary, other realted JS.
I grabbed a example from demo at http://serv1.aelag.com:8084/
/** Socket.IO 0.6.2 - Built with build.js */
/**
* Socket.IO client
*
* @author Guillermo Rauch <guillermo@learnboost.com>
* @license The MIT license.
* @copyright Copyright (c) 2010 LearnBoost <dev@learnboost.com>
*/
this.io = {
version: '0.6.2',
...
How to get that file in normal way and not to steal from other server (maybe unstable or old version) ? And I need exaclty that file. Are there any dependencies ? Should I create it with building it "build.js" or developers did that ?