FAQ Database Discussion Community


WebSocket Error in Eclipse using tomcat

java,eclipse,tomcat,websocket
I tried to deploy a websocket application using Tomcat 7.0 in Eclipse. After i deployed the app on localhost, when i try to access the websocket it throws an error like this WebSocket connection to 'ws://localhost:8080/GroupChatServer/chat?name=hari' failed: Error during WebSocket handshake: Unexpected response code: 404 I deployed the app in...

WebSocket support for Ejabberd

websocket,xmpp,ejabberd
I am looking to implement WebSocket communication via ejabberd xmpp server... The only module that I have found so far is this repository: ejabberd-websockets This repository has not been updated for 4 year so I do not feel very comfortable using it. Any alternatives or reviews on above mentioned repository?...

Remove a square bracket and receiving JSON properly in nodejs/websocket enviroment?

javascript,json,node.js,multidimensional-array,websocket
At the moment I can only output data of a specific key (index) with console.log(auction[index].id); but I need the data using console.log(auction.id);. How do I accomplish this? I'm using nodejs and my WebSocket receives data just like this: 42["stream",{"streamArray":[[{"id":20,"pid":2,"nr":4,"price":5.73,"pe":506.08,"duration":14,"hb":361262},{"id":23,"pid":17,"nr":4,"price":5.59,"pe":189.13,"duration":7,"hb":null},{"id":12,"pid":8,"nr":3,"price":5.59,"pe":90.23,"duration":7,"hb":null}]]}] So it's a multidimensional array. And I think...

Spring-boot app displaying JMS messages on WebPage via WebSocket

websocket,jms,spring-boot,stomp,sockjs
I have an urgent need for a simple web-app in spring-boot that listens for messages on a JMS queue and when arriving it should appear on a webpage via WebSocket. I need a solution for this very soon in a demonstration. I have searched for examples and found several individual;...

Ruby: Establish client connection on particular URI path with ruby TCPSocket

ruby,sockets,websocket,tcpserver,tcpsocket
With Ruby TCPSocket I can do something like this: @socket = TCPSocket.new "174.129.224.73", 80 which corresponds to test echo websocket ws://echo.websocket.org But what if I need to establish connection with the socket based on domain:10440/api/websockets How do I do this with TCPSocket?...

Websocket frame, TCP segment: the relationship?

sockets,networking,tcp,websocket
Websocket is high level protocol based on TCP. Websocket has its own frame https://tools.ietf.org/html/rfc6455#section-5.2 TCP also has its own segment: http://en.wikipedia.org/wiki/Transmission_Control_Protocol So, when using Websocket, send data: First, the data is wrapped in Websocket frame, then, the frame is packed in TCP segments, finally, send the TCP segments out. Am...

websocket + vuejs: screen flickering, visible mustache code

javascript,websocket,vue.js
I built a web-app using websockets, and vuejs. In the DOM I want to loop over the data handled by vuejs. The data however is set later in the timeline, after a websocket connection has been established and the data has been received. Up to that point (about 0.5 seconds),...

Mosquitto 1.4.2 Websocket support

websocket,mqtt,iot,broker,mosquitto
I'm trying to utilize Mosquittos recent update to support websockets in the broker. I'm running Mosquitto v1.4.2 and I've added the following lines to the mosquitto configuration file (mosquitto.conf): listener 10001 127.0.0.1 protocol websockets listener 1883 protocol mqtt When I try and start the broker with the new configuration I...

Inject an application scoped managed bean in a websocket

jsf,websocket,managed-bean
I'm developing a real time application. I have websockets and application scoped managed bean. I'm trying to access the application scoped managed bean from a websocket but I can't. Is this possible? This is my websocket and managed bean (application scoped): @ServerEndpoint("/mediador") @ManagedBean(eager = true) @ApplicationScoped public class Mediador implements...

Add extra headers to websocket connection from browser in Dart

security,authentication,websocket,dart,dart-html
I'm trying to establish an authenticated websocket connection, and this question is a sibling to similar question for server part. How I can add extra headers when I establish a websocket connection from browser? I'm trying to use dart:html's WebSocket object to connect to server requiring a header authentication: containing...

How to emit websocket message from outside a websocket endpoint?

python,flask,websocket,socket.io,flask-socketio
I'm building a website using Flask in which I also use Websockets using Flask-socketIO, but there's one thing I don't understand. I built a chat-functionality. When one user sends a message I use websockets to send that message to the server, after which I emit the message to the other...

Ajax or Websockets for small transmissions

javascript,html,ajax,websocket,socket.io
Im building a Chat website that uses Websockets(Socket.io) to send and receive messages to the server. In fact my website should use Websocket and now my problem is that for other transmissions like checking username at login or fetching JSON and updation DOM and other stuff, Can i use the...

How to listen to socket emit on sails.io.js?

angularjs,node.js,websocket,sails.js,sails.io.js
I'm using Sails 0.11 in my back-end, and angularjs in the front-end. I have a TwitterController in sails with the following code, to open a stream with the Twitter Streaming API (this uses the node module twit): var Twit = require('twit'); var T = new Twit(sails.config.twit); var stream = T.stream('statuses/filter',...

How does meteor perform with many subscriptions over larger documents?

javascript,meteor,websocket
I'm currently designing a database for a fairly large meteor app, and we're debating whether Meteor will perform better using more subscriptions, to collections of tiny documents, or fewer subscriptions to collections of larger documents. Some of these documents could in end become quite large, such as listings of user...

How to set WebSocket Origin Header from Javascript?

javascript,websocket,cross-domain
I'm trying to use javascript to make a websocket request from a local test.dev page to a server running at ip 123.123.123.123 on behalf of test.com. The request goes through, but the 123.123.123.123 server sees the Origin: test.dev header in the websocket request and rejects the connection because it wants...

How To find a WebSocket from a REST bean

rest,jboss,websocket
I have a javascript client that connects to a server via websockets and sends data via ajax to a server. Once the server finished processing the data, I want to send a message via the websocket to the client. Problem is: How do I find the WebSocket from the REST...

How do I use RSVP deferreds with WebSocket?

javascript,websocket,deferred,rsvp.js
I need to open multiple WebSocket connections concurrently and then perform actions once all the connections are opened. I am using the defer(), all(), and then() methods of RSVP.js. However, neither the then() nor the catch() is being triggered, and I cannot figure out where I am going wrong. Here...

Play: stop WebSocket actor in case of failure

scala,playframework,websocket,akka
I'm using Play framework and Akka actors for WebSocket communication. I'm using tryAcceptWithActor method: def socket = WebSocket.tryAcceptWithActor[String, String] { request => Future.successful(request.session.get("user") match { case None => Left(Forbidden) case Some(_) => Right(MyWebSocketActor.props) }) } I would like MyWebSocketActor to Stop when it fails (e.g. throwing an Exception). Is this...

Jetty Web Socket Timeout

javascript,sockets,websocket,jetty
I am trying to establish a Web Socket Connection using Jetty 9.3.0 RC. function checkDetails(port) { var ws = new WebSocket("ws://localhost:9995/application"); ws.onopen = function(event) { console.log("onopen called..."); } ws.onerror = function(event){ console.log('onerror called...'); } ws.onmessage = function(event) { console.log("onmessage called..." + event.data); } ws.onclose = function(event) { console.log("onclose called..." +...

Django, socket.io, node.js - Manage private messages and group conversations

django,node.js,websocket,redis,socket.io
I am in the process of writing a back-end for a service such as Facebook Messenger or WhatsApp. I started out following this splendid tutorial: http://www.maxburstein.com/blog/realtime-django-using-nodejs-and-socketio/ I do this with an API written in Python (Django). Along side with this API, I have a Redis process and a node.js server...

websockets - reject a socket connection

node.js,sockets,websocket
I'm using ws as the socket library for my node.js library. so my question is, how can I reject a connection if the user doesn't pass the authorization process. var WebSocketServer = require('ws').Server; var wss = new WebSocketServer({port: 6969}); wss.on('connection', function(socket){ // if the socket.upgradeReq.headers.cookie doesn't exists, reject the client...

apache websockets reverse proxy

apache,websocket,reverse-proxy
How do I get Apache to reverse proxy web socket connections? I have a chat room application that works fine on the local host but not for connections through the reverse proxy. How do I set this up so that it will work? <VirtualHost *:80> ServerAdmin [email protected] ProxyRequests off DocumentRoot...

How to send messages from server to a specific client

c#,websocket
I am using WebSockets and trying to set up a code base for my server-client. I know how to send messages from client to server and I also know how to listen those messages from the server side. However, how can I send a message back to a client ?...

Handle websocketpp connection path

c++,c++11,websocket,boost-asio,websocket++
I'm really newbie in websocketpp. Can you tell me please, how can i get websocket connection path on new connection in my server? I mean i need to get the part of this: ws://localhost:8080/addr1 ------> get addr1 ws://localhost:8080/addr2 ------> get addr2 ws://localhost:8080/etc ------> get etc I'm using now an example...

Extract client X509 certificate from a secured websocket connection

authentication,websocket,ssl-certificate,x509certificate
I would like to create a certificate-based authentication on top of websocket communication. So I created a websocket serverEndpoint, and set up SSL for client authentication with the help of jetty, like this: Server server = new Server(); //Create SSL ContextFactory with appropriate attributes SslContextFactory sslContextFactory = new SslContextFactory(); //Set...

Creating a real-time chat with Python and websocket

python,websocket,chat,real-time
I'm writing a python real-time chat feature embedded in a web app. I'm a little bit confused on the real time implementation. I need to push real time message to different users. I plan to use websocket but I'm not quite sure how to save those sockets into an array...

Websocket establish bulletproof connection

javascript,firefox,websocket,coffeescript
My coffee code to establish websocket connection when it isn't present return an error: socket = new WebSocket('ws://localhost:8080') #=> Firefox can't establish a connection to the server at ws://localhost:8080/. #=> socket = new WebSocket('ws://localhost:8080'); It's normal behaviour of WebSocket, but I want WebSockets work like this: # pseudocode if websocket.establish_connection()...

PHP Fat-Free-Framework plus Node.js and Secure Websockets

php,node.js,https,websocket,fat-free-framework
I have been tasked with testing the feasibility of using F3 and Node.js along with Socket.IO for our upcoming web-app. The app will use https exclusively. The boss likes F3's templates so that is why we aren't using Node exclusively server side. F3 will be used to serve up the...

How to wait for WebSocket response in PNaCl

c++,google-chrome,websocket,google-nativeclient,ppapi
I'm implementing a "wait for WebSocket response before continuation" mechanism on PNaCl plugin through pp::WebSocketAPI in PPAPI. The following is a simplified version which stores the replied data into a global std::string, while the function myecho() sends a string through WebSocket and polling until the global string changes. The driver...

Flux and WebSockets

javascript,websocket,reactjs,flux
I'm using Flux and WebSocket in my Reactjs application and during implementation I've encountered some problems. Questions: Assuming I have a set of a set of actioncreators and a store for managing the WebSocket connection, and that the connection is started in a actioncreator (open(token)), where should I put my...

Haxe server-client exchange on all platforms

sockets,websocket,client,server,haxe
I'm developing client-server application on haxe. I want client side to be compiled to javascript from haxe, but there is a big chance, that other languages will be also needed. I cannot find universal way of doing it. Though, I can make it with websockets, when it comes to jabascript,...

Why I got so many connection events on Node's HTTP server?

javascript,node.js,http,websocket,socket.io
I have a web application using socket.io. It runs on localhost:8000 on my local machine. In order to find an annoying resource leak in my application, I tried to log out the connection events on my HTTP server: server.on('connection', function(conn) { //log out connection details }); When I open the...

Websocket SSL connection

javascript,node.js,ssl,websocket
I am trying to test a secure websocket but I'm having trouble. Here is my test: var WebSocket = require('ws'); describe('testing Web Socket', function() { it('should do stuff', function(done) { var ws = new WebSocket('wss://localhost:15449/', { protocolVersion: 8, origin: 'https://localhost:15449' }); ws.on('open', function() { console.log('open!!!'); done(); }); console.log(ws); }); });...

Is users socket id a critical information? (security point of view)

javascript,websocket,socket.io
I'm using socket.io to build a chat application. Is it ok if clients receive the socket id of their interlocutors in terms of security? Can the client do something with this information? My assumption is no as only the server can emit message to other clients but I'm new to...

Ajax vs Socket.io

ajax,node.js,websocket,socket.io-1.0
I am developing a web app and I was wondering which method should be suitable for my project. Basically what I want to display to the users are some notifications which are taken from requests to other servers. My node.js app gets all the info and then it spread out...

Springboot @ServerEndPoint “Failed to find the root WebApplicationContext.”

java,spring,websocket,spring-boot,jsr356
I'm having trouble using spring with @ServerEndPoint annotated class i'm using Springboot 1.2.3 and i'm trying to figure it out how to have a single instance of the endpoint @SpringBootApplication @EnableJpaRepositories @EnableWebSocket public class ApplicationServer { public static void main(String[] args) { SpringApplication.run(ApplicationServer.class, args); } } Spring configuration: @ConditionalOnWebApplication @Configuration...

how to check whether web socket is active or not using SRWebsocket

ios,websocket
I'm using SRWebsocket for socket connection. Now I'm calling socket open function whenever the app enter foreground, But i don't want to do that. I need to check first whether the connection is active or not then only open the websocket. Is there any way to do that? - (void)connectWebSocket...

Windows Universal App maintain open WebSocket

c#,.net,websocket,windows-phone,windows-universal
How to have a WebSocket open on Windows Universal App? Can I have my WebSocket be open even when app is closed?

python - When are WebSocketHandler and TornadoWebSocketClient completely deleted?

python,object,websocket,tornado,deletion
I'm working on an application that must support client-server connections. In order to do that, I'm using the module of tornado that allows me to create WebSockets. I intend to be always in operation, at least the server-side. So I am very worried about the performance and memory usage of...

Implementing multi user chat in iPad App

ios,websocket,xmpp,chat
I have an iPad app. I'm planning to add a group chat feature to it. This means 1)users can create or join a group 2)Can text or send audio clips to other users logged into the app. I'm looking for pointers on how to go about implementing this. I read...

Implementing WebSocket in Java Swing Application

java,websocket,java-ee-6,java-ee-7
I created a small java swing application and I want to use WebSocket for the transferring of data from the server to the client. Can someone give me a step by step instructions on how to do it? I'm using JBoss application server.

Play a PCM stream sampled at 16 kHz

websocket,web-audio,pcm
I get a input frame stream through a socket, it is a mono 32-bit IEEE floating point PCM stream sampled at 16 kHz. I get this with the following code : audio File sample With Audacity i can visualize this and i see a regular cuts between my audio flux:...

Mask & Unmask websocket data in python

python,websocket,mask
I have an websocket that is connected to my Websocket server in python, but i can't read any data because it's masked. So i wonder how to mask & unmask data in python, haven't found anything. I have an simillar websocket server in PHP that looks like this: function unmask($text)...

My Websocket takes forever to connect

java,websocket,glassfish,ipv6,tyrus
UPDATE It seems that in org.glassfish.tyrus.core.BaseContainer in the constructor, these two lines run super slow: this.managedExecutorService = lookupManagedExecutorService(); this.managedScheduledExecutorService = lookupManagedScheduledExecutorService(); What is the deal with the mention of Android in the comments of both methods, am I using the wrong code for Java that is aimed at Desktops? I...

Get events listened by socket

node.js,sockets,websocket,socket.io
I am listening to many events on a socket. But when event is fired, the handler function does not get called. I want to check which events are listened by the socket. var socketClient = require('socket.io-client'); var socket = socketClient.connect("server_address_here"); socket.on('event1', function (data) { }); socket.on('event2', function (data) { });...

Check URL of websocket client - python

python,url,websocket
I have a websocket server written in python using https://github.com/dpallot/simple-websocket-server, and I was wondering if it would be possible to check the URL of the website that the client is using to connect to the websocket server? As in, the website is http://websockettest.com/ and I would like to check in...

The most efficient notification system for a web application

node.js,websocket,notifications,xmpp
I have VPS hosting for a business application. It has XMPP based chat with Openfire which is working fine. I want a real time notification system as well in our system. I have these options Ajax Long Poll PHP websockets Node.js Using XMPP(Not sure if applicable) Among all the above....

WebSocket Service update Scope in Angular (Using ngWebSocket)?

javascript,angularjs,websocket
I'm trying to get data coming from a websocket to automatically update value inside a controller's scope. My Service: mimosaApp.service("Device", function ($websocket) { var self = this; var ws = $websocket.$new({ url: "ws://" + window.location.host + ":81", //mock: true, reconnect: true }); this.data = {}; ws.$on("$open", function() { ws.$emit("get", "device");...

Wait for Websocket Rails event to finish in test environment

ruby-on-rails,selenium,rspec,websocket,capybara
I am using the Websocket Rails gem in my Rails application to send an event that triggers a refresh of part of the page. All is working fine, but in my testing (I am using Rspec + Capybara + Selenium) I can't seem to find a way to wait for...

adding websockets to existing php application

php,ajax,node.js,websocket,socket.io
I have an php framework which supports me building websites and allows me to edit the content directly in the frontend via inline editing. I have kind of an api, which receives the updates via an ajax call. So far i was the only one using it, but in the...

If I switch from Javascript polling to websockets, will that reduce server load?

javascript,websocket
I have a web application which provides a dashboard-type display to users on our local network. It gives status updates on a number of different processes and systems via AJAX polling of the server. We're getting to the point where the load on the server is getting to be too...

How to separately assign data to each connected user inside Socket.IO?

mysql,node.js,websocket,socket.io
I am trying to make a card game using Socket.IO, and I am having problems assigning user-specific data (in my case, the cards that each user has). I'm familiar with JavaScript, but I'm just not sure about whether or not there is a specific feature in Socket.IO for assigning user-specific...

Error during WebSocket handshake: location mismatch: wss://* != ws://*

amazon-web-services,meteor,websocket,phantomjs
when i run MeteorJS(1.1.0.2) test in PhantomJS(1.9.8) get this error msg in Amazone AWS Error during WebSocket handshake: location mismatch: wss://ddp--5539-torrentz.meteor.com/sockjs/102/chvlh52p/websocket != ws://ddp--5539-torrentz.meteor.com/sockjs/102/chvlh52p/websocket & this prevent all MeteorJS Mongo DB operations...

HTTP and SignalR

c#,asp.net,sockets,websocket,signalr
I am recently learning about web sockets in .Net and have just found SignalR which seems like too good to be true in terms of the abstraction of what connection to use and it seems like there are a few signalr clients in different languages which is awesome. In my...

Connect to VM using Websocket

javascript,websocket,vcloud-director-rest-api
This could also been treated as a JS question even I'm using a lot of VMware terms. I'm using Websocket to connect to a VM that is hosted by vSphere and is managed by vCloud Director. By vCloud Director API, I can have the security ticket, which is something similar...

How to track 500 errors on WebSockets (ws://)

c#,asp.net,iis,websocket
I'm trying to play around with WebSockets on IIS 8.5. I started off with a couple of very basic C# classes from a lesson: using Microsoft.Web.WebSockets; using System.Web; public class ChatHttpHandler : IHttpHandler { public void ProcessRequest(HttpContext context) { if (context.IsWebSocketRequest) context.AcceptWebSocketRequest(new WebSocketChatHandler()); } public bool IsReusable { get {...

How to improve nodejs / socket io performance?

javascript,node.js,performance,websocket,socket.io
I have set up a server for a little game. The clients send their movement data in a certain interval to the server. The server sends data about the other players, also in a certain interval, to the clients. If I add more players, the performance gets worse. How can...

nginx uwsgi websockets 502 Bad Gateway upstream prematurely closed connection while reading response header from upstream

django,nginx,websocket,redis,uwsgi
I've been banging my head on this issue for days now and have finally reached a brick wall. I've been trying to get my stack to run: http://django-websocket-redis.readthedocs.org/en/latest/running.html#django-with-websockets-for-redis-behind-nginx-using-uwsgi I've been looking at some other SO articles like this one: nginx - uWSGI HTTP + websocket config They seem to have...

Play Specs2: FakeRequest to WebSocket server

scala,playframework,websocket,specs2
I have a controller with the following method def subscribe(id: String) = WebSocket.tryAcceptWithActor[JsValue, JsValue] I've written the following route in conf/routes: GET /subscribe/:id @controllers.WsManager.subscribe(id: String) The application works but I want to do a specific test through Specs2. I tried to "subscribe" to websocket endpoint with: val request = FakeRequest(GET,...

WebSocket messages are lost while client is reconnecting

websocket,activemq,stomp,spring-websocket
I use STOMP.js on the front end and ActiveMQ on the back end for sending push notifications to the client. The client first subscribes to a topic with the following code: function stompConnect() { console.log('STOMP: Attempting connection'); // recreate the stompClient to use a new WebSocket var socket = new...

Terminate previous autobahn websocket call when a new message arrives

python,websocket,twisted,autobahn
I am designing a feature that gives autocomplete-like search results through a websocket. When the user types fast enough, often their previous query becomes outdated because they are already asking for new information. Is there any way to recognize when a new query is incoming, and terminate a previous query?...

primefaces push not working in Safari using AWS Tomcat7

tomcat,primefaces,safari,websocket,push
I am using PrimeFaces 5.1, JSF 2.1 and tomcat 7 and my application is in AWS. atmosphere version 2.2.2. I am not able to use push functionality in Safari 5.1.7. We have configured the AWS to enable push based on Primeface push with AWS , Websocket with Tomcat 7 on...

Scaling a decoupled realtime server alongside a standard webserver

python,websocket,real-time,scalability
Say I have a typical web server that serves standard HTML pages to clients, and a websocket server running alongside it used for realtime updates (chat, notifications, etc.). My general workflow is when something occurs on the main server that triggers the need for a realtime message, the main server...

WebSocket connect another websocket in this browser

javascript,websocket
I have my browser connecting to system hardware application at localhost using websocket. Sometimes this hardware application disabled, so I want to emulate this hardware application directly in the browser by creating another websocket. How can I do this? I tried to emulate it by creating two websockets simultaneously, something...

WebRTC Failed to Add a Third Peer: “Cannot set remote answer in state stable”

javascript,html5,websocket,webrtc
I am writing a multi-peer WebRTC video chat. Two peers have no trouble connecting, no error or warning in console, and video works well, but I cannot add a third party to the chat successfully. On the host (the first participant, Firefox), the error appear as "Cannot set remote answer...

Jetty WebSocket Client Doesn't work for Binary Listener

java,javascript,websocket,jetty-9,libwebsockets
I have a Java app that uses the Jetty WebSocket Client, version 9.x. It works fine for text messages sent from the server, but the binary listener is never invoked. I have a Javascript client implementation which I'm basically duplicating. I'm doing the same exact thing in Javascript that I...

WebSocket serverSocket.Accept() doesn't trigger

c#,websocket,network-programming
I am trying to send strings to a server using Synchronous WebSockets in a C# console application. The following code works flawlessly on 127.0.0.1 but doesn't work on any real server I tried. The result I get is that the client connects to the IP/Port and sends strings with no...

Prevent that a MySQL row updates two times at once? (nodejs mysql)

javascript,mysql,node.js,websocket,socket.io
I have this code in my server nodejs file to update a row in a mysql db with the mysql module using socket.io that's updating every second: var query_update = mysql.query('UPDATE `auctions` \ SET `random` = ?,`price`= ?,`datetime` = ? WHERE `id` = ?', \ [rand, price, t, auction.id]); console.log('\n'+time()+query_update.sql+'\n');...

WebSocket connection failed: WebSocket opening handshake was canceled

javascript,amazon-web-services,amazon-ec2,websocket
I have recently setup an EC2 instance (in a VPC with no load balancer) and admittedly the configuration is a bit odd, but it is what is required for the web application we're running. The web server (in Haskell) is running on port 4433 (standard ports are reserved for an...

Faye Ruby Server Side Publish on Heroku - EventMachine buffer overflow detected

heroku,websocket,out-of-memory,publish-subscribe,faye
I have a faye ruby client on a heroku worker (using sidekiq - 5 threads) that publishes to the faye server running on linode. The worker crashes after a few minutes with a buffer overflow detected message. *Code EM.epoll EM.run { publication = @client.publish('/glive-bullion','body'=>body) publication.callback do EM.stop_event_loop end publication.errback do...

How can I override the Origin header in Chrome when connecting to a WebSocket?

javascript,google-chrome,websocket
I am trying to connect to an external web socket server, which is not run by myself. I would like to connect to it from a localhost javascript file, therefore the origin header has null value. I understand that this is a measure against cross-site forgery. However, since I am...

asp.net 5 web application with websockets on Windows 7

websocket,signalr,asp.net-5
I have a relatively simple web application that I am currently porting to asp.net 5. The current version runs under IIS on some Windows 7 and Server 2008 machines. With the next version of my software I would like to connect a C++ client via SignalR to the web application....

socket io Websocket Disconnected Node js

javascript,node.js,express,websocket,socket.io
I am actually facing an issue here. I am having a login page From there I am going to another page. From there I am getting my socket disconnected. What i am trying to do is In my server side app.js app.post('/login', urlencodedParser, function(req, res) { req.session.username = req.body.usr; req.session.password...

SignalR client on Windows Server 2008R2 using Server Sent Events

websocket,signalr
Server: Windows Server 2012 with WebSocket support Client Machine 1: Windows 8.1 Client Machine 2: Windows Server 2008R2 I built a C# application using the SigalR client that I can delpoy on my two client machines. However, the issue that I am running in to is that Client Machine 1...

How to turn off authentication for websockets in Spring Security?

java,spring,java-ee,spring-security,websocket
I've got a Java EE application which uses Spring Security for authentication (configured with Java config). The same application contains a websocket server implemented with javax.websocket package. My question is how to turn off Spring Security authentication for any incoming websocket connections without turning off HTTP authentication?...

PHP base64 encoding drops incorrect answer

php,websocket,base64
I'm currently working on a website, which must implement a web-socket server. I am using PHP to make the server. I extracted a Sec-websocket-key from the clients response, then I hashed it using the PHP sha1() command. The problem is that when I want to base64_encode it then it gives...

Deploy python web server on AWS Elastic Beanstalk

python,amazon-web-services,websocket,webserver,elastic-beanstalk
I'm deploying an python web server on AWS now and I have a some question about it. I'm using websocket to communicate between back end and front end. Do I have to use framework like django or flask? If not, where should I put the index.html file? in other word,...

Meteor: Error during WebSocket handshake: Unexpected response code: 400

node.js,meteor,websocket
What could be the possible cause of the error Error during WebSocket handshake: Unexpected response code: 400? The app is hosted on ubuntu and deployed using the npm mup package. I included my bundled ssl pem file within mup.json. Is there anything else that I need to configure on the...

Where do sockets fit into the Flux unidirectional data flow?

javascript,websocket,socket.io,reactjs,flux
Where do sockets fit into the Flux unidirectional data flow? I have read 2 schools of thought for where remote data should enter the Flux unidirectional data flow. The way I have seen remote data for a Flux app fetched is when a server-side call is made, for example, in...

Firefox crashes when a websocket call answered

firefox,websocket,asterisk,sipml
I'm experimenting with asterisk 13 and sipml5 on a cantos virtual machine, Everything is configured properly. I use Firefox 38.0.1 to make calls from an extension to the other, and till last night everything worked just fine. Now today when I start to call an extension and want to...

Websocket.disconnect() method throws java.net.SocketException: Socket closed

android,websocket
I am using android-websockets library from codebutler in my project. But I ran into problem when I execute disconnect() method. Following is the code: public void disconnectServer() { if(client != null) { try { if(client.isConnected()) { client.disconnect(); } } catch (Exception e) { e.printStackTrace(); } } } I get the...

Reactjs working with sockets: rerender when socket receive a message

javascript,websocket,coffeescript,reactjs
I'm try to implement something like chat application with usage of websockets. But when websocket got a message, no components are rerendering. Please review my code # The main ancestor, chat application @Chat = React.createClass componentWillMount: -> @setState signals: [] # the list of signals received by websockets socket =...

Rails Rspec test that a controller has triggered Websockets event

ruby-on-rails,testing,rspec,websocket
In my controller I have the following code that triggers a websockets event inside the update method: WebsocketRails[recipient.id].trigger "new_activity", "Shared" if recipient.online? How can I test that my controller is triggering this event?...

em-websocket send() send from one client to another through 2 servers

ruby-on-rails,ruby,websocket,em-websocket
I have two websocket clients, and I want to exchange information between them. Let's say I have two instances of socket servers, and 1st is retrieve private information, filter it and send to the second one. require 'em-websocket' EM.run do EM::WebSocket.run(host: '0.0.0.0', port: 19108) do |manager_emulator| # retrieve information. After...

When is WebSocket.onmessage triggered?

javascript,websocket
(1) Open a WebSocket connection. var ws = new WebSocket(url); (2) When connection is established, send a message which will trigger a blob sent back in response. ws.onopen = function () { ws.send('1000000'); } (3) Is onmessage triggered when the response begins or is complete? ws.onmessage = function () {...

Tornado behind Nginx, should I use TCP nodelay config in python or nginx.conf?

nginx,tcp,websocket,tornado
I have a Tornado server running behind Nginx reverse proxy. The proxy is configured with tcp_nodelay: on. I see there's also an option to call WebSocketHandler.set_nodelay(True) on a WebSocket instance once it's connected. Do these two create the same effect? Are there pro's con's for using one over the other?...

How to implement a WebSocket server serving only 1 client at a time

c++,websocket,websocket++
I'm using WebSocket++ library to implement a WebSocket server. Due to the characteristic of my server, I would like it to serve only 1 client at a time. That is, once a client has been connected to my server, I would like it to stop listening from other potential clients...

Websocket call timeout on Javascript Client

javascript,php,websocket
I'm using websockets for the first time and am unsure what I am doing wrong. Due to my IP being dynamic, I am using the following websocket call serverside: $echo = new echoServer("myurl.com","9000"); and the following call clientside: socket = new WebSocket("wss://myurl.com:9000"); I get a timeout err even though the...

How to send contents of a webrtc stream directly to my server?

javascript,websocket,webrtc
I've recently started getting into webRTC and would like to stream my webcam to my web server. However, I can only seem to find concrete examples of doing this peer to peer. I know the very basics: navigator.getUserMedia(constraints, successCallback, errorCallback); function successCallback(stream) { // I want to send the output...

Why does Jetty JSR356 behave differently with regards to checkOrigin and modifyHandshake

java,websocket,jetty,jsr356
I was playing around with Jetty (9.2.3v20140905) by connecting a web socket endpoint where I tried to use my own ServerEndpointConfig when I came across Jetty's code to see how it was used. I notice that it is used in JsrCreator when a web socket object is created: Object createWebSocket(ServletUpgradeRequest...

KdB+ - HTML5 websocket deserializer not working for Long data type

html5,websocket,kdb
I am using the deserializer from http://kx.com/q/c/c.js for interfacing HTML 5 websocket to KdB+ backend. I am facing issues while sending null values of type j(long) from the backend. The deserializer for some reason maps it to 64-bit integer min value i.e., -9223372036854775808. Non-null values are getting deserialized properly though....

ratchet HttpServer class not found

php,websocket,composer-php,ratchet
So i made a real-time chat on windows in php with websockets and every thing worked perfectly but now when i try to run the server on my vps(debian) i get this error PHP Fatal error: Class 'Ratchet\http\HttpServer' not found in /react-chat/bin/server.php on line 11 so when i look at...

Socket between browser and iOS devices

ios,websocket,socket.io
We have a proprietary template format for rendering articles. We have written an editor in HTML for editing this. While editing/writing the template we want a live preview of the results directly on different iOS and android devices through a custom app we've made to preview. It seems redundant to...

Phantomjs not rendering Angular + Websockets page

angularjs,websocket,phantomjs,prerender
Running into a situation where some complex pages (complex in terms of nested views) are not rendering at all in Phantom (using http://prerender.io) I'm using: Phantom 1.9.8 Websocket 1.2.0 Angular 1.3.1 I think it's an issue with websockets because the pages I've tested that don't rely on sockets seem to...

Websocket does not seem to connect

java,android,websocket
package com.example.chat; //client for a server import java.net.URI; import java.net.URISyntaxException; import org.java_websocket.client.WebSocketClient; import org.java_websocket.handshake.ServerHandshake; import android.app.Activity; import android.os.Bundle; import android.util.Log; import android.view.Menu; import android.view.MenuItem; import android.view.View; import android.view.View.OnClickListener; import android.widget.Button; import android.widget.EditText; public class MainActivity extends Activity { private Button b1;...

Why does nodejs have incremental memory usage?

node.js,websocket
I have a gameserver.js file that is well over 100KB's in size. And I kept checking my task manager after each refresh on my browser and kept seeing my node.exe memory usage keep rising every refresh. I'm using the ws module here: https://github.com/websockets/ws and figured, you know what, there is...

Websocket (java ee) how to get role of current user

security,java-ee,websocket,wildfly
I just added a Websocket endpoint to my java ee jax-rs application. Within Jax-Rs endpoints i can access the role of the user via SecurityContext. But within websocket i can't inject context stuff. So how to know the role of the user that tries to open a websocket session?...

How to defer reading until writing is done?

javascript,node.js,mongodb,websocket,socket.io
I'm making a multiplayer game using node.js, socket.io and MongoDB. When a player die they can reload the browser just before the fatal hit and still be alive even though the kill was registered. I'm using the following solution to save/load a player: socket.sockets.on('connection', onSocketConnection); function onSocketConnection(client) { util.log('New player...

Websocket client disconnect websocket4net

android,websocket,mono,websocket4net
I've been having random websocket disconnects. My stack is: Monodroid Websocket4net Spring websockets I'm not sure if anyone else has experienced this. Usually the client will work perfectly and then randomly, it'll experience a disconnect. Any help or insights would be appreciated....

Sending message from Websocket server to client java-websocket

java,websocket,java-websocket
I have the following web socket server code from http://java-websocket.org/: public class WebsocketServer extends WebSocketServer { private static int PORT = 2005; private Set<WebSocket> conns; public WebsocketServer() { super(new InetSocketAddress(PORT)); conns = new HashSet<>(); } @Override public void onOpen(WebSocket conn, ClientHandshake handshake) { conns.add(conn); System.out.println("New connection from " + conn.getRemoteSocketAddress().getAddress().getHostAddress());...