Last active
June 24, 2019 11:33
-
-
Save ishikota/6baaf3be69b665eb2e53cce799d7be9d to your computer and use it in GitHub Desktop.
actioncableにpythonのwebsocket-clientから接続しようとした途中経過
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> from websocket import create_connectio | |
>>> ws = create_connection("ws://localhost:3000/cable") | |
>>> ws.send(r'{"identifier":"{\"channel\": \"RoomChannel\"}", "command": "subscribe"}') | |
77 | |
>>> ws.recv() | |
'{"identifier":"_ping","type":"confirm_subscription"}' | |
>>> ws.send(r'{"identifier" : "RoomChannel", "command": "message", "data": "{\"message\" : \"hoge\", \"action\" : \"speak\" }"}') | |
119 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
クライアント実装方針