KX Community

Find answers, ask questions, and connect with our KX Community around the world.
KX Community Guidelines

Home Forums kdb+ kdb+ and websockets Re: kdb+ and websockets

  • rocuinneagain

    Member
    February 10, 2023 at 12:00 am

    To make reusable as more of a library it’d need a few extensions.

    Like if more than one / in the URL.

    This would work with 1 or more:

    q)wsConn:{i:first where "/"=x;x:(i#x;i _x);(`$":ws://",x 0;"GET ",x[1]," HTTP/1.1rnHost: ",x[0],"rnrn")} 
    q)wsConn"localhost:8000/ws-replay/somethingelse?exchange=bitmex&from=2019-10-01&to=2019-10-02" 
    `:ws://localhost:8000 
    "GET /ws-replay/somethingelse?exchange=bitmex&from=2019-10-01&to=2019-10-02 HTTP/1.1rnHost: localhost:8000rnrn"

    Would also need to account for

    a) No / in the URL

    b)  Embedded / in the options (if allowed)