嘟嘟社区

100元红包 get请求升级成wss


本帖最后由 wop 于 2022-9-9 22:37 编辑

利用python  发送了一个get 请求  服务器响应101 升级到wss 请求  请问该怎么实现呢  

  1. 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
  2. Host: webcast3-ws-web-lf.douyin.com
  3. Connection: Upgrade
  4. Upgrade: websocket
  5. Sec-WebSocket-Version: 13
  6. Sec-WebSocket-Key: kemPMDpR6ryJUDEa7Qt3nA==
  7. Connection:  Upgrade
  8. Pragma:  no-cache
  9. Cache-Control:  no-cache
  10. User-Agent:  Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.198 Safari/537.36
  11. Upgrade:  websocket
  12. Origin:  https://live.douyin.com
  13. Sec-WebSocket-Version:  13
  14. Accept-Encoding:  gzip, deflate, br
  15. Accept-Language:  zh-CN,zh;q=0.9
  16. Cookie:  ttwid=1%7CTAP5nm5GQB3zsFW_ioDyf6AQDIQUv9GsomdP6YOB3ZE%7C1655184319%7C8111775928f5782e10bd1f2a9739391c0a9df9c0a50afddb2a7bfb24ac70ace7;
  17. #  响应头
  18. HTTP/1.1 101 Switching Protocols
  19. Server: Tengine
  20. Content-Type: application/octet-stream
  21. Connection: upgrade
  22. Date: Fri, 09 Sep 2022 12:50:34 GMT
  23. Upgrade: websocket
  24. Sec-WebSocket-Accept: 03lNFTwc99uK0i7reNRgAkRTcDE=
  25. Handshake-Status: 0
  26. Handshake-Msg: OK
  27. Handshake-Options: ping-interval=15;
  28. server-timing: inner; dur=6
  29. x-tt-trace-host: 01cfbf159d9d2a921da1ca89e0bd14ae7770fb8126cd1ae7a10d19c760d15a924e7187dc2eaec3414266d881cbbdd831cfc18997a508cddad3844585d210c739da7ebc543653a8bff868bfead0c1801de5c2930f1813e70e29caa50127018dcd5bc20483ebc39de85c8f98f30d98525e1f
  30. x-tt-trace-tag: id=3;cdn-cache=miss
  31. Via: cache4.l2cn2600[116,0], cache11.cn1802[178,0]
  32. Timing-Allow-Origin: *
  33. EagleId: 6f7b359f16627278345871679e

复制代码

同问此问题,大佬来解答
有能解决的大佬吗?
标题起对了
标题怎么被吞了
或者有没有能提供思想指导的
能不能如果是ws就用websocket-client干 其他用request
要求值100,但得加上起步价