dcaoyuan / spray-socketio

socket.io for spray
Apache License 2.0
253 stars 55 forks source link

How to publish a message in a certain channel (namespace) #71

Open santiagopoli opened 9 years ago

santiagopoli commented 9 years ago

Hi! I need to implement a Web Server which receives a message via HTTP POST and forwards it via socket.io. For example:

POST http://localhost:8080/c1
Body: {"message":"Hello World"}

I want then, to send the message {"message":"Hello World"} to the c1 channel via socket.io (if someone is connected to the socket must receive that message).

The HTTP part is done: I can receive a POST request and intercept both the body and the URI, but then I want to connect to a certain namespace via socket.io and forward the message.

Thanks in advance!