Created
August 15, 2018 12:12
-
-
Save coeric/28abab36e453cfde8c803190e1b369e7 to your computer and use it in GitHub Desktop.
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
#-*- coding:utf-8 -*- | |
#!/usr/bin/env python | |
import websocket | |
url="wss://rs1.sa8888.net:6125/?device=Web_main&token=Web_main_kvi4yxlses0tilzxok5y0jox/" | |
headers={ | |
"Accept-Encoding": "gzip, deflate, br", | |
"Accept-Language": "zh-TW,zh;q=0.9,en-US;q=0.8,en;q=0.7", | |
"Cache-Control": "no-cache", | |
"Connection": "Upgrade", | |
# "Cookie": "__cfduid=df2c1dbf75a38088b838211e9997ea12a1534317875; visid_incap_1673245=JnJg2wTeT/6RQAQhv94M/jPVc1sAAAAAQUIPAAAAAABUQSKS2QJzZ5x1MX6pTzEP; incap_ses_625_1673245=aep2EVDY5zpNv50D7XKsCDPVc1sAAAAAGA2Ni91j/IoakO1ST9ws3Q==; sp_fr_lang=1; bb_08/15=All", | |
"Host": "rs1.sa8888.net:6125", | |
"Origin": "https://web2.sa8888.net", | |
"Pragma": "no-cache", | |
"Sec-WebSocket-Extensions": "permessage-deflate; client_max_window_bits", | |
"Sec-WebSocket-Key": "2f1ZU9Ppg33g5q5mBhk8mQ==", | |
"Sec-WebSocket-Version": "13", | |
"Upgrade": "websocket", | |
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36", | |
} | |
res=websocket.create_connection(url,headers=headers) | |
print res | |
res.send('S#1{"action":"first","system":"Web_main","token":"Web_main_kvi4yxlses0tilzxok5y0jox","language":"zh","fvPK":{},"order":1,"syn":1}E#1') | |
print res.recv() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment