利用python发送了一个get 请求服务器响应101 升级到wss 请求请问该怎么实现呢
- GET /webcast/im/push/?aid=6383&app_name=douyin_web&browser_language=zh-CN&browser_name=Mozilla&browser_online=true&browser_platform=Win32&browser_version=5.0%20%28Windows%20NT%2010.0%3B%20WOW64%29%20AppleWebKit%2F537.36%20%28KHTML%2C%20like%20Gecko%29%20Chrome%2F86.0.4240.198%20Safari%2F537.36&compress=gzip&cookie_enabled=true&cursor=h-1_t-1662727834449_r-1_d-1_u-1&device_platform=web&did_rule=3&identity=audience&imprp=u6aaWJgUDQM2xAQQsbHq66ZTXFySI&live_id=1&room_id=7141242509404998413&screen_height=1080&screen_width=1920&tz_name=Asia%2FShanghai&update_version_code=0.0.13&version_code=180800&webcast_sdk_version=0.0.13 HTTP/1.1
Host: webcast3-ws-web-lf.douyin.com
Connection: Upgrade
Upgrade: websocket
Sec-WebSocket-Version: 13
Sec-WebSocket-Key: kemPMDpR6ryJUDEa7Qt3nA==
Connection:Upgrade
Pragma:no-cache
Cache-Control:no-cache
User-Agent:Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
Upgrade:websocket
Origin:https://live.douyin.com
Sec-WebSocket-Version:13
Accept-Encoding:gzip, deflate, br
Accept-Language:zh-CN,zh;q=0.9
Cookie:ttwid=1%7CTAP5nm5GQB3zsFW_ioDyf6AQDIQUv9GsomdP6YOB3ZE%7C1655184319%7C8111775928f5782e10bd1f2a9739391c0a9df9c0a50afddb2a7bfb24ac70ace7;
#响应头
HTTP/1.1 101 Switching Protocols
Server: Tengine
Content-Type: application/octet-stream
Connection: upgrade
Date: Fri, 09 Sep 2022 12:50:34 GMT
Upgrade: websocket
Sec-WebSocket-Accept: 03lNFTwc99uK0i7reNRgAkRTcDE=
Handshake-Status: 0
Handshake-Msg: OK
Handshake-Options: ping-interval=15;
server-timing: inner; dur=6
x-tt-trace-host: 01cfbf159d9d2a921da1ca89e0bd14ae7770fb8126cd1ae7a10d19c760d15a924e7187dc2eaec3414266d881cbbdd831cfc18997a508cddad3844585d210c739da7ebc543653a8bff868bfead0c1801de5c2930f1813e70e29caa50127018dcd5bc20483ebc39de85c8f98f30d98525e1f
x-tt-trace-tag: id=3;cdn-cache=miss
Via: cache4.l2cn2600[116,0], cache11.cn1802[178,0]Timing-Allow-Origin: *
EagleId: 6f7b359f16627278345871679e
热议
2楼 WZ-Software 昨天22:20
同问此问题,大佬来解答
3楼 wop 昨天22:28
有能解决的大佬吗?
4楼 笑花落半世琉璃 昨天22:29
标题起对了
5楼 wop 昨天22:31
标题怎么被吞了
6楼 wop 昨天22:51
或者有没有能提供思想指导的
7楼 hysbeta 昨天22:53
能不能如果是ws就用websocket-client干 其他用request
8楼 251768938 昨天23:44
9楼 wop 8分钟前
要求值100,但得加上起步价
起步价多少 详细聊聊
10楼 u78 2分钟前
必须得用import websockets
申明:本文内容由网友收集分享,仅供学习参考使用。如文中内容侵犯到您的利益,请在文章下方留言,本站会第一时间进行处理。
评论前必须登录!
立即登录 注册