|Syntactic Confectionery Delight|
Persistent connection to a websocket/gateway (wss://)by james28909 (Chaplain)
|on May 16, 2017 at 16:02 UTC||Need Help??|
james28909 has asked for the
wisdom of the Perl Monks concerning the following question:
Howdy Monks! I am back again with another question. I am trying to establish a persistent connection to a gateway/websocket so i can add some functionality! I were trying to use REST::Client, but when the time come to do the connection/handshake with the actual gateway, i got something like "protocol not supported", which I took as REST::Client didnt support wss. I can connect to the api server all day long and read messages with REST::Client, but i cannot seems to post responses from my bot.
So this is where I started floundering around and copy/pasting code while not understanding it. Besides copy/pasting code, I believe IO::Socket would be a better approach to this, but I dont fully understand the whole server/client thing great either.
I would post some code but it would be the first failed attempt with the "protocol not supported" error.
To post code, I will post some psuedo code because I am not very sure as to what I need to do to actually make the request and read the responses with IO::Socket.
Do I need a server, or a client, or do I need a server and client? any help is very much appreciated :)
I appreciate any hints of wisdom.