Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jan 31 2019 18:13
    brycekahle commented #466
  • Jan 31 2019 07:50
    UltraNemesis commented #466
  • Jan 31 2019 07:49
    UltraNemesis commented #466
  • Jan 31 2019 06:49
  • Jan 30 2019 23:30
    brycekahle commented #470
  • Jan 30 2019 19:34
    brycekahle closed #471
  • Jan 30 2019 19:34
    brycekahle commented #471
  • Jan 30 2019 08:36
    zhanguangcheng starred sockjs/sockjs-client
  • Jan 30 2019 08:05
  • Jan 30 2019 06:43
    fourcels starred sockjs/sockjs-client
  • Jan 30 2019 04:16
    laoer starred sockjs/sockjs-client
  • Jan 30 2019 03:56
    hkaikai commented #471
  • Jan 30 2019 03:54
    hkaikai edited #471
  • Jan 30 2019 01:16
    xzzh999 commented #470
  • Jan 29 2019 17:23
    brycekahle closed #470
  • Jan 29 2019 17:23
    brycekahle commented #470
  • Jan 29 2019 17:22
    brycekahle commented #471
  • Jan 29 2019 15:02
    suifengpiao4515 starred sockjs/sockjs-client
  • Jan 29 2019 08:13
  • Jan 29 2019 03:01
    Molly2Molly starred sockjs/sockjs-client
Bryce Kahle
@brycekahle
*test failures
Andrew Hansen
@arahansen
I have another question for you guys. How would I go about testing my client implementation of sockjs? I've been able to get my client up and running with a socket connection, and my logic seems to be functional. But, of course, I'd like to unit test the onopen, onmessage, and onclose functions. How can I mock a server emitting a socket message to my client and test my response logic? I'm using Angular and Karma/chai if that helps.
Bryce Kahle
@brycekahle
Rather than test sockjs-client again and having to deal with how to format messages so sockjs-client will understand them, I suggest you mock it since it has a simple interface (the WebSocket API).
So you can have a simple mock object that calls onopen, onmessage, and onclose as part of your tests
Jacob
@jacob1237
Hey guys! Who knows how to use the bower-installed SockJS-client library with Browserify?
Bryce Kahle
@brycekahle
@jacob1237 The bower installed version is UMD, so you should be able to require it like normal
Dan
@danpantry
Hello. Just wondering, is there a way to prevent the auto-connection of SockJS? Lets say I'd like to create a Socket, but I don't want it to connect right now, but rather defer it to some later point -or would you consider this a code smell?
Never mind; just remembered this library attempts to really follow the spec :)
Raider21
@Raider21
This message was deleted
Michael Toomim
@toomim
How do people debug network problems with sockjs? I have messages being sent from a Chrome client that never get fired by my server's connection.on() handler. How can I find out where the message disappears?
Is there a way to print out low-level websocket data from sockjs? Or a good way to sniff the raw network connection? I haven't had success with either approach yet, and would love some help.
Michael Toomim
@toomim
We've now been able to sniff the network traffic, and we can see a message arriving at the computer's network interface, but it isn't triggering our callback for 'data' events. How do I debug in between these points?
Michael Toomim
@toomim

Ah, problem seems to be solved. I found the place to insert a print statement by triggering a crash from within my .on('data', ..) handler and looking at the stack trace. I added a print statement to the first call that came after node's internal junk, which was in faye's websocket driver, and found that the network frame was reaching the physical interface but was not actually getting to faye. This meant that the bug was either in the OS or in node.

I tried upgrading node to v4 (I was at v.10) and the bug went away. So the solution was to upgrade node. Apparently there are bugs with old versions of node when running semi-heavy websockets traffic.

Stephan Hoyer
@StephanHoyer
Hi
I want to close the server if there are no connections anymore. Is this possible?
naive attempt would be to count on('connection') and conncetion.close, but this seems fragile to me
Stephan Hoyer
@StephanHoyer
how can I set cors headers?
BStenfors
@BStenfors
I am curious. Has anyone setup SockJS-Node? If so, is there a way to configure topics like you can in Spring? This way STOMP can subscribe to a topic.
Luis Vargas
@luisvt
Hello, looking into sockjs-client I found that it was added dist folder to .npmignore
shouldn't be removed from .npmignore so client side dev can be done
??
Luis Vargas
@luisvt
@brycekahle do you know why tests are failing?
Yerkon
@_Yerk0n_twitter
HI everyone!
I have problem similar to this with latest Firefox Developer Edition 51.0a2. Works fine on Chrome
webpack/webpack-dev-server#544
I think problem with between Firefox and SockJs
Ignas Bernotas
@ignasbernotas
Hi guys, I’m using sockjs with Primus. Once the connection is established, I want to insert/update a database record, once that’s done I’d like to start handling the messages so I’d know which user based on my DB record sent the message. The problem is that if I wait for the database queries to finish I will miss the initial messages from the client since binding the data event only happens afterwards. If I bind the data event first, I will not know which client sent the message. What’s the logical way to approach this?
I could probably bind the event and before I know the client, store the messages in an array and after the database work is done, take the messages from the array and reassign them to the client.
messages will also be stored in a database
Kostya Gerasimovich
@magictolledo_twitter
Prasanth TJ
@PrasanthTJ
I get the below error msg whenever my sockjs establishes connection with my server
Uncaught failure in sockjs request. Websocket handshake failure.nested exception is java.lang.illegalargumentexception: No 'javax.websocket.server.servercontainer' servlet context attribute. Are you running in a servlet container that supports JSR-356
Majid
@mmobini
@magictolledo_twitter done.
Ali Akbar Azizkhani
@removed~azizkhani
Hi all
Ryan
@TheeRFG
I'm having an issue where my connections are failing and I have no idea why
We are trying to use SockJS with StompJS . Our site runs wicked slow and I notice my connection seems to go through all the fallback protocols at about 15s intervals... is there anyway to up the fallback delay? I'm just trying to eliminate this as a possible issue.
Ryan
@TheeRFG
I have a websocket 101 connection open... it has an o and a bunch of h's I don't remember what the o stands for, but it's very clearly responding to heartbeats still
at the same time it looks like it tried to fall to xhr_streaming then iframe then htmlfile and then jsonp and then it just dies for good. "Whoops! Lost connection to..."
even while it's dead it's still responding to heartbeats.... but it's just not actually working
any ideas?
Ryan
@TheeRFG
on second look fallback connections seem erratic
xhr doesn't seem to work at all either... is there some spring configuration magic I missed for this?
Ryan
@TheeRFG
I'm still having this issue
Aleix Morgadas
@aleixmorgadas

hello everyone,

I'm facing an issue with the CORS, the issue is with the CORS Credential is not supported if the CORS header ‘Access-Control-Allow-Origin’ is ‘*’, how could I change the Headers?

Searching in the repository, there's a Options parameter in the constructor, but there's not an option to set the Access-Control-Allow-Origin :-/
Aleix Morgadas
@aleixmorgadas
The server returns Access-Control-Allow-Origin: *, and I cannot control the implementation (external service), is there a work arround?
Aleix Morgadas
@aleixmorgadas
I've solved it using the version 0.3.4
Jai Pradeesh
@jaipradeesh
Is this library being maintained? Considering for production use.
Jai Pradeesh
@jaipradeesh
Is there some sort of redis adapter which is recommened by sock.js. I am planning to implement it on multiple nodes. Not sure if this is the right channel (Since topic says sockjs client)
Ali Akbar Azizkhani
@removed~azizkhani
hi all
i have application that write with spring websocket and using sockjs in clinet