本帖最后由 wop 于 2022-9-9 22:37 编辑
利用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
-
复制代码
|