Questions tagged [nowjs-sockets]

NowJS, by Flotype Inc is a now deprecated which is a JavaScript server framework built on top of Node.js. For questions related to the Now CLI from ZEIT, use the [zeit-now] tag instead.

[Deprecated] NowJS creates a magic namespace "now", accessible by server and client. Functions and variables added to now are automatically synced, in real-time. Call client functions from the server and server functions from client.

http://nowjs.com/

123 questions
1
vote
1 answer

NowJS - client/browser communication (wihout contacting "everyone")

It is possible to define (client-side): now.function = function(){console.log('test');} ... that is called by server using: everyone.function() - but can it be executed on specific client's browser only (using something like:…
biphobe
  • 4,525
  • 3
  • 35
  • 46
1
vote
3 answers

Value of proxying HTTP requests with node.js

I have very recently started development on a multiplayer browser game that will use nowjs to synchronize player states from the server state. I am new to server-side development (so many of the things I'm saying are probably being said…
Piers Mana
  • 382
  • 4
  • 13
1
vote
0 answers

Handling browser window close in a nowjs chat application

I am creating a chat application with nowjs.User can create a chatroom and then invite users to that room.Following is the code used to do this: everyone.now.addPeopleToChat = function(clientIds,roomName) { var length = clientIds.length; var…
user700284
  • 13,540
  • 8
  • 40
  • 74
1
vote
2 answers

Session support in Now.js

Now.js quotes: Simply pass a connect or express http server in nowjs.initialize and this.user.session should be available. So: express = require 'express' app = module.exports = express.createServer() connect = require 'connect' nowjs = require…
Patrick
  • 7,903
  • 11
  • 52
  • 87
1
vote
0 answers

display messages on page refresh using nowjs

from the nowjs.org example, i have this code: var server = require('http').createServer(function(req, res){ res.end(html); }); server.listen(9080); console.log("This server's process pid is: " + process.pid); var nowjs = require("now"); var…
khinester
  • 3,398
  • 9
  • 45
  • 88
1
vote
1 answer

Need recommendations for pattern for now.js object sharing in group

I have an application where I want to use node.js and now.js to share the state of an object within a nowjs "group" across any number of clients. As an example of what I'm trying to do, let's say that within the multiroom chat example that comes…
CircusNinja
  • 267
  • 1
  • 6
  • 13
1
vote
1 answer

Node.js callback confusion

I am trying to implement an autocompleter on a nodejs app using nowjs. everyone.now.sendAutocomplete = function(search) { var response = getAutocomplete(search); console.log("response"); console.log(response); }; which calls: function…
Jonovono
  • 3,437
  • 5
  • 42
  • 64
1
vote
2 answers

Access Now.js and express.js from the web folder

Where do I have to install Now.js and express.js to access it from the web folder? My web-folder is located here: /var/www/virtual/domain.com/htdocs and I'm using node v.0.6.6 But when I install now.js with "npm install now" in the root folder, I…
Christian Strang
  • 8,470
  • 5
  • 42
  • 53
1
vote
2 answers

Differentiate between two clients in nowjs

I'm using nowjs for my webapp. How do I differentiate between two clients. I tried using req.session and also using global variable in the main app.js file. But I haven't succeeded properly in attaining what I need. My main aim is to handle these…
Boopathi Rajaa
  • 4,659
  • 2
  • 31
  • 53
1
vote
1 answer

error when calling the distributeMessage method using now.js

Started playing with the now.js framework. Using the example code in now.js I'm trying to implement a chat. Including here for completeness.