nowjs-sockets

What is the difference between dnode and nowjs?

橙三吉。 提交于 2020-01-28 13:11:30
问题 How do the two compare to each other? 回答1: TL;DR DNode provides RMI; remote functions can accept callbacks as arguments; which is nice, since it is fully asynchronous; runs stand-alone or through an existing http server; can have browser and Node clients; supports middleware, just like connect ; has been around longer than NowJS. NowJS goes beyond just RMI and implements a "shared scope" API. It's like Dropbox, only with variables and functions instead of files; remote functions also accept

What is the difference between dnode and nowjs?

你。 提交于 2020-01-28 13:08:30
问题 How do the two compare to each other? 回答1: TL;DR DNode provides RMI; remote functions can accept callbacks as arguments; which is nice, since it is fully asynchronous; runs stand-alone or through an existing http server; can have browser and Node clients; supports middleware, just like connect ; has been around longer than NowJS. NowJS goes beyond just RMI and implements a "shared scope" API. It's like Dropbox, only with variables and functions instead of files; remote functions also accept

socket.io as a client

谁都会走 提交于 2020-01-12 18:43:07
问题 is there any way to run socketio as a client(not a browser, but a nodejs script) I need to broadcast data from a server to some clients (browsers) and to another linux machine (only running nodejs to get variables, no browser) Any ideias is welcome Regards 回答1: There is a project on github which implements a socket.io client. Take a look here: https://github.com/remy/Socket.io-node-client var socket = new io.Socket('localhost', 8000); socket.on('connect', function () { console.log('yay,

codeigniter & node js integration with now js - how to access view files

杀马特。学长 韩版系。学妹 提交于 2019-12-30 02:28:09
问题 i want to integrate codeigniter and node.js but i am having confusion that how to execute both node.js and codeigniter. I have successfully installed and ran the nowjs sample: http://nowjs.com/doc/example how to access view files of codeigniter(or any php framework) into node.js. i have confusion because codeigniter executed with url http://localhost/xyz while node.js executed with http://localhost:8080/xyz so which url i have to write in browser from which i can use both node.js &

how to get external ip of the server from node.js

感情迁移 提交于 2019-12-23 05:50:11
问题 I'm using now.js and there's this line that refers to localhost. In order for someone to access the server outside I need to modify localhost to be the current external ip of my computer(my ip is dynamic). Is there any way to detect the current external ip from the script? window.now = nowInitialize("//localhost:8081", {}); 回答1: You could ask an external service like this one (which is nice because it returns it without formatting). To use it, you could use Node's built in http module:

codeigniter nodejs and nowjs integration

大兔子大兔子 提交于 2019-12-21 19:54:21
问题 I am trying to integrate nodejs and nowjs with codeigniter framework, As I dont have time to rewrite the whole site I want to check if a user is logged in. I am using ion_auth and I am storing the session in db. Client js: var session_id = $.cookie('sc_session'); $("form").submit(function() { now.distributeMessage($("textarea").val(),session_id); }); now.receiveMessage = function(message){ $("body").append("<br>" + message); }; Heres the nodejs server code: EDIT :* Simplified it a little, and

502 Bad Gateway when using ExpressJS with nginx

时光怂恿深爱的人放手 提交于 2019-12-20 20:27:46
问题 If I run my expressjs app like so: coffee server.coffee and navigate to localhost:8080 , everything works just fine. However, when I reverse proxy 8080 with nginx with the following configuration: server { listen 0.0.0.0:80; server_name localhost; access_log /var/log/nginx/nodetest.log; location / { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; proxy_set_header X-NginX-Proxy true; proxy_pass http://node/

Session support in Now.js

元气小坏坏 提交于 2019-12-19 11:20:08
问题 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 'now' everyone = nowjs.initialize(app) The output of this.user is: { clientId: '353725111301231610', cookie: { 'connect.sid': 's0meC00k1e1nF0rm4ti0n' }, session: undefined } Any idea why session is undefined? 回答1: I ran into this problem and turns out

nowjs/node-proxy fails to install on ubuntu 11.10

ε祈祈猫儿з 提交于 2019-12-13 17:19:32
问题 I'm trying to install now.js on ubuntu 11.10 (running on windows with wubi, if that matters). I've downloaded and installed node, npm, and socket.io just fine, but sudo npm install now fails for some reason. I've tried with and without sudo, tried installing it globally, same error. Make is installed just fine...is it some problem with the node-proxy package? For what it's worth, trying npm install node-proxy produces a similar error. node version 0.6.2 npm version 1.0.106 ubuntu 11.10

Nowjs expressjs 3.0

纵饮孤独 提交于 2019-12-13 06:43:41
问题 I´m trying to get nowjs to work with expressjs 3.0alpha4. I´ve added the script to my view like so: <script src="/nowjs/now.js"></script> And have also tried: <script src="https://localhost/nowjs/now.js"></script> But all i get is a: GET https://localhost/nowjs/now.js 403 (Forbidden) Have anyone gotten this to work with expressjs 3.0.? Even if i host the now.js file, I still get: Now is not defined 回答1: You need to pass an HTTPServer object to the now initializer. Express 3.0 doesn't reveal