Search code examples
c#wampsharp

How to send a command when connecting started in WampSharp


I encountered with this problem Can't connect to Poloniex . I think I found a solution. I need to send a command when I open connecting. Like this.

from websocket import create_connection
import json

ws = create_connection("wss://api2.poloniex.com:443")
ws.send('{"command" : "subscribe", "channel" : 1001}')

while True:
    result = ws.recv()
    json_result = json.loads(result)
    if len(json_result) >= 3:
        print(json_result)

ws.close()

But it code for Python. How can I made it in WampSharp?


Solution

  • WampSharp is a library for the WAMP protocol. The code you attached does not use the WAMP protocol, but a different custom WebSocket subprotocol. Therefore this service can not be consumed using a WAMP library.