Socket.IO

Node.js - MJPEG TCP stream to base64 images

ε祈祈猫儿з 提交于 2019-12-22 12:08:07
问题 Based on paparazzo.js lib, I'm trying to get base64 images from a MJPEG stream (streamed over TCP with GStreamer) in a Node.js server, and to send them to the clients via websockets. I think I'm pretty close, but my images are corrupted. Here is the code I'm using : var boundary = "----videoboundary"; var data = ""; var tcpServer = net.createServer(function (socket) { socket.on('data', function(chunk) { var boundaryIndex = chunk.toString().indexOf(boundary); if (boundaryIndex !== -1) { // Get

Adding django-socketio to existing Apache/mod_wsgi/Django site

╄→гoц情女王★ 提交于 2019-12-22 11:22:45
问题 Can anyone provide or link to a tutorial for adding django-socketio functionality to an existing Django site that uses Apache and mod_wsgi? Can they work in parallel or does the runserver_socketio command need to handle all requests? This Question is related but offers little practical information. Thanks 回答1: You should be able to run the regular site behind a public facing server like Apache, with the runserver_socketio part just serving websockets on a separate port. As described in the

Sending video and audio stream to server

我是研究僧i 提交于 2019-12-22 10:53:51
问题 I am trying to develop a system where there are two clients that can video chat to each other from their browsers over a server. First client sends its video stream to the server and the server sends it to the second client. Also, server saves client's stream as a video file. I used this WebRTC example: https://github.com/webrtc/samples/blob/master/src/content/getusermedia/source/js/main.js Server side; var express = require('express'); var app = express(); var http = require('http').Server

is it possible to use flash sockets and websockets simultaneously with socket io?

别说谁变了你拦得住时间么 提交于 2019-12-22 10:53:49
问题 I have been struggling with this for some days now, trying to find information everywhere but I couldn't solve it. Basically, I have a flash client app and a browser - chrome based app connected to a socket io - nodejs serve instance. As you know, Chrome works over websockets and my flash app works over flash sockets. Everything works well between chrome and node, but when I make any interaction from my flash app, that degrades the connection type to flash sockets instead of websockets making

Connecting to a node.js server from C#

…衆ロ難τιáo~ 提交于 2019-12-22 10:33:45
问题 I'm trying to write a simple server that .NET clients can connect to to exchange messages. Any message from any client will go to all of the others. node.js + socket.io seems like a good way to go here, but I'm having trouble. I'm using sample code from the socket.io site, and when I connect to it from a browser, the console traces out all the connection and heartbeat events as it should, so I think I've at least got the environment setup correctly. My client code (pasted below) is very

Why doesn't io.emit() work in process.on()?

白昼怎懂夜的黑 提交于 2019-12-22 10:26:57
问题 I'm trying to apply this so that my server will tell the clients when it is closed. I don't understand why the server will not emit. It seems like the program closes before it gets a chance to emit, but console.log() works. I think my problem probably has to do with the synchronous nature of process.on as mentioned here, but honestly I don't understand enough about what (a)synchronous really means in this context. Also, I'm on Windows 7 if that helps. // catch ctrl+c event and exit normally

Socket.io-client no default export

浪尽此生 提交于 2019-12-22 10:17:10
问题 I'm currently working on a project in polymer 3, one of the components needs to import socket.io-client but whatever i try i can't get it to work. I have tried: import io from 'socket.io-client'; what i get back: Uncaught SyntaxError: The requested module '../../node_modules/socket.io-client/lib/index.js' does not provide an export named 'default' same for this: import io from 'socket.io-client/dist/socket.io.js'; what i get back: Uncaught SyntaxError: The requested module '../../node_modules

Does node.js, backbone, socketio and express and coffee script all go together?

[亡魂溺海] 提交于 2019-12-22 10:06:33
问题 I'm trying to get an overview of what's latest and greatest, and was curious how all these different technologies fit together. Is it like this: Nodejs is a webserver, backbone is just a framework that will run on nodejs? SocketIO is a library that works with backbone then? And the actual code can be written in coffescript, which when compiled, will be javascript. What about express then? Could this be used. Please point out if these are components/frameworks that don't work together etc. 回答1

Has Phonegap integrate socket.io in version 3.5.0-0.20.10?

◇◆丶佛笑我妖孽 提交于 2019-12-22 09:56:48
问题 Since I've update my PhoneGap to version 3.5.0-0.20.10 I get problems in my project. When I'm running the PhoneGap service, then I see in the cli; [phonegap] 200 /socket.io/?EIO=2&transport=polling&t=....... But I don't use socket.io . Using the Chrome developer tools I see that in my project is a socket.io folder with a socket.io.js . So I think PhoneGap import it by itself. And my RequireJS have now a problem: Uncaught ReferenceError: io is not defined I tried to remove RequireJS, then it

Socket.io send disconnect event with parameter

喜欢而已 提交于 2019-12-22 09:48:41
问题 I want to send disconnect event manually with custom parameter to socket.io server. I use this function but won't work: //client var userId = 23; socket.disconnect(user); //Server socket.on('disconnect', function (data) { console.log('DISCONNECT: '+ data) }) Now how can I send a additional data to server when disconnect event sent? 回答1: Socket IO's disconnect event is fired internally but you can emit a custom event when it is called. You need to first listen for the disconnect event. Once