-
Notifications
You must be signed in to change notification settings - Fork 147
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
client side possibility? #47634
Comments
Of course. :) If you create WebSocket endpoints with Pushpin, then any WebSocket clients can connect to them, including the JavaScript WebSocket object in the browser. Creating WebSocket endpoints requires server development though, to react to Pushpin's proxied events. Did you write any such code yet? If not, you can try Pushpin's test mode, which lets you connect and publish without having to write backend code. First make sure your
The test mode has a WebSocket endpoint living at var ws = new WebSocket('ws://localhost:7999/ws');
ws.onmessage = function (message) {
console.log(message.data);
}; Then from a terminal, you can publish using the
Please note that in a real application you would write backend code instead of using the test mode. |
wow thats great |
sorry to reopen this but i am getting some errors i botted a docker pushpin container and i created a ws server in GO server, with javascript ws i tried to connect to the go server but the ws connection is dropped
and i get this error on the server
apparently i mixd things up, ws://localhost:7999/ was the right client port but now i am getting WebSocket connection to 'ws://localhost:7999/channel' failed: Error during WebSocket handshake: Unexpected response code: 502 or Error while proxying to origin. while accessing with HTTP get request which i think shows me that its the right url/port |
What does your |
hello |
so what you described above with
|
good news, directly from a linode instance works.
i will investigate further |
The docker image routes to |
that makes sense |
hello
is there a library or a way to use javascript websocket to listen on a channel?
i am getting an net::ERR_EMPTY_RESPONSE
thanks
The text was updated successfully, but these errors were encountered: