0.2.5 • Published 10 years ago

qufox v0.2.5

Weekly downloads
1
License
MIT
Repository
github
Last release
10 years ago

Qufox

npm version

node.js smiple web messaging server.

service is running at http://qufox.com and https://talk.talsu.net

Installation

$ [sudo] npm install qufox -g

Usage

Execute server on command line

Usage : qufox -p [num] -r [url] -i [num]  -s -w -o

Options:
  -p, --port        listen port
  -r, --redisurl    redis server url (when use multiple nodes)
  -w, --websocket   use websocket protocol

Set config file (config.json)

{
	"servicePort" : "4000",
	"websocket" : true
}

Unsing multiple nodes. (need redis server)

{
	"servicePort" : "4000",
	"redisUrl" : "redis://localhost:6379",
	"websocket" : true
}

Example

Server side
$ qufox --port 4000

Service is running at http://localhost:4000

Client side
<script src="./bower_components/socket.io-client/socket.io.js"></script>
<script src="./javascripts/qufox-client.js"></script>
<script>
	var client = Qufox('http://localhost:4000');

	client.join('sessionName', function (message) {
	  alert(message);
	});

	client.send('sessionName', 'hello world');
</script>

Alert popup appears on the first page when you open two same pages.

Module

var QufoxServer = require('qufox');

new QufoxServer(4000);

or

new QufoxServer({
	listenTarget: 4000,
	socketOption: {transports:['websocket', 'polling']},
	redisUrl: "redis://localhost:6379"
});

Service is running at http://localhost:4000

Client

qufox client code is in qufox-client.

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.2.2

10 years ago

0.2.1

10 years ago

0.2.0

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago