Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

possible to use router on client side? #15

Open
loveencounterflow opened this issue Jan 15, 2015 · 2 comments
Open

possible to use router on client side? #15

loveencounterflow opened this issue Jan 15, 2015 · 2 comments

Comments

@loveencounterflow
Copy link

I'm using socket.io-client in my NodeJS client side app; can i use socket.io-events to listen to events from there, too? Specifically, i'd like to call a function on each socket event that arrives, catching all the events. Is that possible?

@NathanGRomano
Copy link
Member

Not yet but that does sound like an awesome feature to do

On Thu, Jan 15, 2015 at 2:03 PM, loveencounterflow <[email protected]

wrote:

I'm using socket.io-client in my NodeJS client side app; can i use
socket.io-events to listen to events from there, too? Specifically, i'd
like to call a function on each socket event that arrives, catching all the
events. Is that possbile?


Reply to this email directly or view it on GitHub
#15.

@loveencounterflow
Copy link
Author

meanwhile, i've done this:

socket            = ( require 'socket.io-client' ) 'http://0.0.0.0:3000/'
original_onevent  = socket.onevent.bind socket

socket.onevent = ( Q ) ->
  [ type, data, ] = Q[ 'data' ]
  console.log type, JSON.stringify data
  original_onevent Q

which will show any incoming event and could dispatch to other functions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants