etherdelta / bots

EtherDelta example bots
95 stars 121 forks source link

pyhton API: where does "42" prefix come from? #6

Open RomanBrodetski opened 6 years ago

RomanBrodetski commented 6 years ago

https://github.com/etherdelta/bots/blob/3bc9411117c7b5a3f50d653ea437285afa86f312/python/etherdeltaclientservice.py#L362

Here it seems like all the method invocations contain a leading "42" number. I didn't find this described in the docs. Where does it come from? I'm trying to replicate the python client behaviour using scala and akka-http without much luck. I keep ending up with the following response:

0{"sid":"ndWNgwRDSzvcRkioAABg","upgrades":[],"pingInterval":25000,"pingTimeout":60000}
40

cc @tomvanbraeckel

RomanBrodetski commented 6 years ago

I figured out that the API provided is not plain websockets API. It's socket.io API with only websocket transport enabled (It would be nice to edit the API description to reflect this fact).

These "42" numbers is what socket.io uses for namespacing.

mshenfield commented 6 years ago

Linking some resources for future users: