Socket.IO

nodejs, expressjs serving PHP files

假装没事ソ 提交于 2019-12-30 06:42:14
问题 Ok I've been playing around with nodejs, expressjs and socket.io to create some applications. But now im coming to the stage where i want to take things a bit further. I have noticed a few node apps using PHP for twitter auth on their client side. When I attempt to rename my client.html file to client.php and restart the server it throws up a blank page with this Cannot GET / How do would serve php files or would i do twitter auto using js? This is my NodeJS server.js var http = require('http

DataChannel.state() always returns CONNECTING webRTC Android

元气小坏坏 提交于 2019-12-30 06:23:12
问题 I have an android app running as a client of WebRTC server running at Node.js server. The current state of the app is I can make video calls but can't send the message on DataChannel. Here is my complete code for the android app. Home.java public class Home extends Activity { public List<PeerConnection.IceServer> iceServers; private GLSurfaceView videoView; public static SocketIO socket; ArrayList<String> userIDs = new ArrayList<>(); private static final String FIELD_TRIAL_VP9 = "WebRTC

Socket.io disconnect client by id

烈酒焚心 提交于 2019-12-30 03:29:45
问题 I'm new to nodejs and trying to write a chat room as so many people have. The chat consists of multiple rooms and clients. Commands such as /nick /join /help /ls users /ls rooms work as you would expect although I'm having trouble with getting a /kick command to work. I'm just not sure how you disconnect a client by id, so far /kick client is able to present the respective clients socket.id although I'm stuck for the code to kick via socket.id. Code so far: Disconnect client who sent /kick :

How to make Apache and Node.js with Socket.io setup work?

旧时模样 提交于 2019-12-30 03:07:27
问题 Just starting with Node.js/Socket.io. Ultimately I want to serve the pages from Apache while pushing and augmenting some of the content with Node.js server. This is just a little test to see how it all works. Here is my setup: Apache running on port 8080 Node.js running on port 8000 I copied the index.html page (see below) to their respective root directories. When I open http://localhost:8000 everything works as expected and I can see the complete message exchange. When I open http:/

Testacular install fails, no vcbuild.exe

十年热恋 提交于 2019-12-30 01:46:11
问题 I'm trying to install Testacular (using nmp) on a Windows 8 Professional (64 bit) laptop, but it fails when it tries to install socket.io as part of this process. The error I get is Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. I apparently have .NET framework 3.5 installed (it's checked under the add

how to detect that user's connection is lost or he closed the browser window in Nodejs socket.io

前提是你 提交于 2019-12-30 00:39:13
问题 I have a chat application on Node.js and Socket.io, user can connect and disconnect with a button... I am having a list of online users which is perfectly managed with the help of my defined events that user trigger. But the problem is I am unable to detect if the user has lost his connection or closed the browser window without disconnecting himself manually(by the disconnect button)... This socket.io event is fired only when user disconnects himself not when he lost his connection. socket

How to implement Socket.IO with ASP.Net, IISNode, Node.JS, and SQL Server for event-based push notifications?

喜欢而已 提交于 2019-12-30 00:32:23
问题 For a notification project, would like to push event notifications out. These are things like login, change in profile, etc., and to be displayed to the appropriate client. I would like to discuss some ideas on putting it together, and get some advice on the best approach. I noticed here that changes made to a CouchDB can be detected with a _changes stream, picked up by Node, and a process kicks off. I would like to implement something like this (I'm using SQL Server, but an entry point at

socket.io / parameters on connection

独自空忆成欢 提交于 2019-12-29 18:52:54
问题 In my node.js / Express.js app, I need to pass parameters with the socket.io connection (saw that in another post). On client side, I have something like : edit var socket = io.connect('/image/change', {query:"name=my_img_name"}); var siofu = new SocketIOFileUpload(socket); siofu.listenOnInput(document.getElementById("change_image_inpt")); On server side : edit io.of('/image/change') .on('connection', function (socket) { console.log('log input param : ' + socket.handshake.query.name); }); But

socket.io / parameters on connection

故事扮演 提交于 2019-12-29 18:52:27
问题 In my node.js / Express.js app, I need to pass parameters with the socket.io connection (saw that in another post). On client side, I have something like : edit var socket = io.connect('/image/change', {query:"name=my_img_name"}); var siofu = new SocketIOFileUpload(socket); siofu.listenOnInput(document.getElementById("change_image_inpt")); On server side : edit io.of('/image/change') .on('connection', function (socket) { console.log('log input param : ' + socket.handshake.query.name); }); But

socket.io / parameters on connection

孤街醉人 提交于 2019-12-29 18:52:02
问题 In my node.js / Express.js app, I need to pass parameters with the socket.io connection (saw that in another post). On client side, I have something like : edit var socket = io.connect('/image/change', {query:"name=my_img_name"}); var siofu = new SocketIOFileUpload(socket); siofu.listenOnInput(document.getElementById("change_image_inpt")); On server side : edit io.of('/image/change') .on('connection', function (socket) { console.log('log input param : ' + socket.handshake.query.name); }); But