You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Crazy idea here and early days, but what if we could have the Pode server act as a client and connect to other external WebSockets?
So far it seems possible, and it would include something like the following functions:
# connect to some external websocket (like slack for example)Connect-PodeWebSocket-Name 'Slack'-Url '<url>'-ScriptBlock {} [-ArgumentList]
# like Send-PodeSignal, but for external WebSocketsSend-PodeWebSocket-Name 'Slack'-Message 'Message'# close a current connectionDisconnect-PodeWebSocket-Name 'Slack'# could be used to reset a connections URL (if it expires). possible? could require current logic?Reset-PodeWebSocket-Name 'Slack'-ScriptBlock {}
The Connect-PodeWebSocket would open an async connection to some external websocket endpoint. It will then listen for requests, and call the scriptblock when received. You can send messages to the websocket using Send-PodeWebSocket.
This will happen in a seperate runspace, so it can be async. At the moment this runspace will only be created if any Connect- calls are made in the main Start-PodeServer scope, but I'm wondering if it's possible to create connections adhoc from anywhere 🤔
The text was updated successfully, but these errors were encountered:
I've managed to get Pode to connect to other websockets, acting as a client. Running one Pode server as a websocket server, and then another connecting to the other server works fine.
At the moment I'm testing connecting to Slack's RTM websockets, to try and write a Slack bot. I can receive messages from Slack, but Slack doesn't seem to like the responses 🤔
Crazy idea here and early days, but what if we could have the Pode server act as a client and connect to other external WebSockets?
So far it seems possible, and it would include something like the following functions:
The
Connect-PodeWebSocket
would open an async connection to some external websocket endpoint. It will then listen for requests, and call the scriptblock when received. You can send messages to the websocket usingSend-PodeWebSocket
.This will happen in a seperate runspace, so it can be async. At the moment this runspace will only be created if any
Connect-
calls are made in the mainStart-PodeServer
scope, but I'm wondering if it's possible to create connections adhoc from anywhere 🤔The text was updated successfully, but these errors were encountered: