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

Does websocket.receive only look for new messages sent to the server? #134

Closed
dmilleravid opened this issue Apr 18, 2016 · 1 comment
Closed

Comments

@dmilleravid
Copy link

dmilleravid commented Apr 18, 2016

In the case of a chat server, all the users (clients) are connecting to my server (host) and websocket.connect and receive and disconnect work wonderfully, because my server is managing all the connections.

But what about the case when my server (as a client) would like to make a websocket connection to another server (as host), like it would for a Slack Bot? For example, if I implement a Slack Bot, I'd like to connect to Slack and use consumers to manage messages that Slack sends over the websocket connection. Slack would host the websocket and my app would connect as a client.

I've tried this, but when I establish a connection to Slack, the websocket.connect event does not execute. Further, once I'm connected to Slack and Slack sends a message to all connected clients, websocket.receive does not fire.

Am I implementing something incorrectly? Can my server connect to other servers through a websocket connection and have consumers manage the messages as they are added to the websocket connection?

Would love to know how you'd implement something like this using this.

@andrewgodwin
Copy link
Member

You can't do outgoing websockets with the current protocol server, it's incoming only - a new protocol server would be needed to be written to support outgoing, with a new spec (things like messages saying what to connect to).

As for Slack itself, I would like to see a higher-level Slack protocol server that lets consumers be written against slack-specific channel names (like slack.userjoin or slack.message).

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