websocket fail on bitmex

402 views
Skip to first unread message

agoodname

unread,
Dec 22, 2017, 4:17:20 AM12/22/17
to Kdb+ Personal Developers
Hi Q Gods,

I got into the following issue by trying to connect to bitmex websocket but stuck for days.

h:`:ws://www.bitmex.com "GET /realtime HTTP/1.1\r\nHost: www.bitmex.com\r\n\r\n"

I got the following error:
(0Ni;"HTTP/1.1 301 Moved Permanently
Content-length: 0

")


My other websockets all work except the one above. For example, this is fine.

h:`:ws://ws.blockchain.info "GET wss://ws.blockchain.info/inv HTTP/1.1\r\nHost: ws.blockchain.info\r\n\r\n"

Thanks!!

Flying

unread,
Dec 22, 2017, 5:55:33 AM12/22/17
to Kdb+ Personal Developers
301 status code tells you that you need to use the new URL as returned instead of the old one.

agoodname

unread,
Dec 22, 2017, 10:49:48 AM12/22/17
to Kdb+ Personal Developers
So what do I need to change exactly? change `:ws to `:wss?

agoodname

unread,
Dec 28, 2017, 9:45:48 AM12/28/17
to Kdb+ Personal Developers
problem solved. thanks for the tips
Message has been deleted

Jonathon McMurray

unread,
Apr 25, 2018, 2:02:57 PM4/25/18
to personal...@googlegroups.com

Correct URL is wss://www.bitmex.com/realtime

 

Using https://github.com/jonathonmcmurray/ws.q seems to work fine:

 

jmcmurray@homer ~/git/ws.q (master) $ q ws.q

KDB+ 3.5 2017.11.30 Copyright (C) 1993-2017 Kx Systems

l64/ 8()core 16048MB jmcmurray homer.aquaq.co.uk 127.0.1.1 EXPIRE 2018.06.30 AquaQ #50170

 

q).bmx.upd:show

q).bmx.h:.ws.open["wss://www.bitmex.com/realtime";`.bmx.upd]

q)"{\"info\":\"Welcome to the BitMEX Realtime API.\",\"version\":\"2018-04-24T18:56:54.000Z\",\"timestamp\":\"2018-04-25T17:53:04.162Z\",\"docs\":\"https://www.bitmex...

 

Hope that helps

Jonathon

 

From: personal...@googlegroups.com <personal...@googlegroups.com> On Behalf Of rtrader
Sent: 25 April 2018 11:26
To: Kdb+ Personal Developers <personal...@googlegroups.com>
Subject: [personal kdb+] Re: websocket fail on bitmex

 

how did you solve the problem? I am facing the same issue

--
You received this message because you are subscribed to the Google Groups "Kdb+ Personal Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to personal-kdbpl...@googlegroups.com.
To post to this group, send email to personal...@googlegroups.com.
Visit this group at https://groups.google.com/group/personal-kdbplus.
For more options, visit https://groups.google.com/d/optout.


This e-mail message is intended to be received only by persons entitled to receive the confidential information it may contain. E-mail messages to clients of AquaQ Analytics may contain information that is confidential and legally privileged. Please do not read, copy, forward, or store this message unless you are an intended recipient of it. If you have received this message in error, please forward it to the sender and delete it completely from your computer system.

agoodname

unread,
May 1, 2018, 11:44:28 AM5/1/18
to Kdb+ Personal Developers
yes the right uri is `wss.

still they need to configure the SSL wrapper in order to do this, just fyi

To post to this group, send email to persona...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages