Socket.IO

node v0.5.0 pre Socket.IO crashes on connection (independent of transport)

我与影子孤独终老i 提交于 2019-12-24 05:57:51
问题 When I try to connect to socket.io it crashes with the following error message: Initializing client with transport "websocket" node: ../src/node.cc:1212: ssize_t node::DecodeWrite(char*, size_t, v8::Handle<v8::Value>, node::encoding): Assertion `b[1] == 0' failed. Aborted This happens when I try to start up the node chat example. (server.js file in the example folder). The installed socket.io version is the current version installed by using npm install socket.io. Does anyone know what the

Property 'Server' does not exist on type 'typeof “http”'

我们两清 提交于 2019-12-24 05:37:35
问题 I know that var someModule = require('someModule') is generally replaced by import * as someModule from 'someModule' but I can't figure out how to use Typescript/ES6 syntax to express the following Node.js code: var server = require('http').Server(app); After reading import and call a function with es6 I have tried the following: import * as httpModule from 'http'; const server = httpModule.Server(app); and the code does compile and run properly but I still get this TS error: [ts] Property

SocketIO, can't send emit data from client

别等时光非礼了梦想. 提交于 2019-12-24 05:15:14
问题 I'm having the most odd problem trying to send data from a client browser to my node server using SocketIO. Sending from server to client works just fine, but the other way around I get an undefined error. Here's a quick bit of what it looks like, super simple. Node Server (app.js) io.on("connection", function(socket) { socket.on("pageReady", function(data) { console.log('pageReady called'); console.log(data); return socket.emit('newline', '###SOCKET STARTED###'); }); socket.on("disconnect",

How to upload file using socket.io-stream?

回眸只為那壹抹淺笑 提交于 2019-12-24 05:05:54
问题 This is my source code. <server.js> var app = require('./app.js'); var socketIO = require('socket.io'); var ss = require('socket.io-stream'); var path = require('path'); var fs = require('fs'); var server = app.listen(53322, function() { console.log('server is working at port 53322'); }); var io = socketIO.listen(server); io.on('connection', function (socket) { ss(socket).on('file', function(stream, data) { console.log(data); var filename = path.basename(data.name); var filepath = path.join('

400, 502, 503 errors with Websockets

可紊 提交于 2019-12-24 04:26:11
问题 I am making a multiplayer game using Socket.io, Node.js, and Openshift. It was working for a while, but I made a few small changes and now something unrelated to what I changed has broken. When a second player tries to join the game, it boots everyone out, showing a 503 error for anyone else who goes on the site. For the second player, I get a lot of console errors including WebSocket connection to 'ws://avalon-evao.rhcloud.com/socket.io/?EIO=3&transport=websocket&sid=d5smykffy4EWHxgIAAAC'

SailsJS: Requiring Assets, Such As, sails.io.js

混江龙づ霸主 提交于 2019-12-24 03:52:45
问题 As the problem is short & sweet, I'll keep the question so. CAN'T LOAD ASSETS. Using Sails.js ( v0.11.n ). Can't load assets... That's about it... I'm trying to load sails.io.js -- or now even just assets/alert.js . <script type="text/javascript" src="/js/dependencies/sails.io.js"></script> Doesn't work :( Even when I switch the src to /alert.js -- nothing. I'm pasting this script tag inside of my /signup view -- which loads fine -- but I know sure as heck I'm doing something(s) wrong. 回答1:

SailsJS: Requiring Assets, Such As, sails.io.js

試著忘記壹切 提交于 2019-12-24 03:52:04
问题 As the problem is short & sweet, I'll keep the question so. CAN'T LOAD ASSETS. Using Sails.js ( v0.11.n ). Can't load assets... That's about it... I'm trying to load sails.io.js -- or now even just assets/alert.js . <script type="text/javascript" src="/js/dependencies/sails.io.js"></script> Doesn't work :( Even when I switch the src to /alert.js -- nothing. I'm pasting this script tag inside of my /signup view -- which loads fine -- but I know sure as heck I'm doing something(s) wrong. 回答1:

RESTful Api or Socket.IO

 ̄綄美尐妖づ 提交于 2019-12-24 03:47:07
问题 Im writing a mobile application. It connects to the node.js server and getting some data. Which is the best way to retrieving data from nodejs server? My project architecture: mySQL DB <-> node.js (Server) <--(socket.io or restful)--> mobile clients 回答1: If you need a bidirectional real-time connection between your server and your client (e.g. a chat bot or a stock ticker), then socket.io would be a good choice. However if you just need to fetch some data from time to time on the client from

Making Socket.IO work from localhost through WAMP Server

最后都变了- 提交于 2019-12-24 03:32:36
问题 I'm very new to using websocket. While I have a lot of experience in coding as a professional, I've never had to use socket for live update information. I know my way around PHP, MySQL, HTML, CSS and JS (or jQuery). My project is already started in PHP and MySQL but I need to add some "live" part. The goal of the websocket app would be to check for any change in the Table within the MySQL DB and notify the necessary client if applicable. I didn't wanted to "refresh" the page every so often as

netty socket io CORS error: Access-Control-Allow-Origin

时光总嘲笑我的痴心妄想 提交于 2019-12-24 03:11:34
问题 I have wamp server running https, java netty socket.io server secured by SSL, and socket.io client. In client I have folowing code: io.connect(url, {secure: true} ); the url is: https://127.0.0.1:8080 When I open in my browser my webserver: https://127.0.0.1 I have following error: socket.io-client:manager reconnect attempt error +1ms socket.io.js (wiersz 1284) socket.io-client:manager will wait 4000ms before reconnect attempt +1ms socket.io.js (wiersz 1284) engine.io-client:socket socket