我这边http代理又出了问题,请帮我看一下什么原因。
连接直接在同局域网内可以直接播放,使用转发主要为了外网播放。现在播放不了,日志如下:
2026/09/02 22:27:10 INFO [Worker 0] New client 192.168.1.3:64746 requested URL: /http/gslb.itv.jsinfo.net:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1 (method: GET) 2026/09/02 22:27:10 DEBUG [Worker 0] Host header validated: iptv.example.com 2026/09/02 22:27:10 DEBUG [Worker 0] Created HTTP proxy service: /http/gslb.itv.jsinfo.net:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1 -> http://gslb.itv.jsinfo.net:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1 2026/09/02 22:27:10 INFO [Worker 0] X-Forwarded-For accepted: 192.168.1.1 2026/09/02 22:27:10 DEBUG [Worker 0] Timezone: No TZ marker in User-Agent 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Parsed URL - host=gslb.itv.jsinfo.net, port=6060, path=/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Connection to gslb.itv.jsinfo.net:6060 in progress (async, IPv4) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Async connection initiated 2026/09/02 22:27:10 INFO [Worker 0] HTTP Proxy: Connected to gslb.itv.jsinfo.net:6060 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Built request headers (311 bytes, body 0 bytes) for gslb.itv.jsinfo.net:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Sent headers 311 bytes (311/311) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Request sent (311 headers + 0 body bytes) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Response status: 302 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Content-Type: text/html 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Content-Length: 156 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Location: http://180.96.165.44:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Rewritten Location: http://180.96.165.44:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 -> /http/180.96.165.44:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Forwarded 304 bytes of headers to client 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Received all content (156 bytes) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Transfer complete 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Cleaning up session (socket=-1) 2026/09/02 22:27:10 INFO [Worker 0] New client 192.168.1.3:64747 requested URL: /http/180.96.165.44:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 (method: GET) 2026/09/02 22:27:10 DEBUG [Worker 0] Host header validated: iptv.example.com 2026/09/02 22:27:10 DEBUG [Worker 0] Created HTTP proxy service: /http/180.96.165.44:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 -> http://180.96.165.44:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 INFO [Worker 0] X-Forwarded-For accepted: 192.168.1.1 2026/09/02 22:27:10 DEBUG [Worker 0] Timezone: No TZ marker in User-Agent 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Parsed URL - host=180.96.165.44, port=6060, path=/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Connection to 180.96.165.44:6060 in progress (async, IPv4) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Async connection initiated 2026/09/02 22:27:10 INFO [Worker 0] HTTP Proxy: Connected to 180.96.165.44:6060 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Built request headers (350 bytes, body 0 bytes) for 180.96.165.44:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Sent headers 350 bytes (350/350) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Request sent (350 headers + 0 body bytes) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Response status: 302 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Content-Type: text/html 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Content-Length: 156 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Location: http://180.96.143.71:6410/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Rewritten Location: http://180.96.143.71:6410/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 -> /http/180.96.143.71:6410/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Forwarded 304 bytes of headers to client 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Received all content (156 bytes) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Transfer complete 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Cleaning up session (socket=-1) 2026/09/02 22:27:10 INFO [Worker 0] New client 192.168.1.3:64748 requested URL: /http/180.96.143.71:6410/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 (method: GET) 2026/09/02 22:27:10 DEBUG [Worker 0] Host header validated: iptv.example.com 2026/09/02 22:27:10 DEBUG [Worker 0] Created HTTP proxy service: /http/180.96.143.71:6410/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 -> http://180.96.143.71:6410/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 INFO [Worker 0] X-Forwarded-For accepted: 192.168.1.1 2026/09/02 22:27:10 DEBUG [Worker 0] Timezone: No TZ marker in User-Agent 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Parsed URL - host=180.96.143.71, port=6410, path=/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Connection to 180.96.143.71:6410 in progress (async, IPv4) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Async connection initiated 2026/09/02 22:27:10 INFO [Worker 0] HTTP Proxy: Connected to 180.96.143.71:6410 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Built request headers (350 bytes, body 0 bytes) for 180.96.143.71:6410/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Sent headers 350 bytes (350/350) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Request sent (350 headers + 0 body bytes) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Response status: 302 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Content-Type: text/html 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Content-Length: 126 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Location: http://180.96.143.76:6610/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739&ispcode=156 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Rewritten Location: http://180.96.143.76:6610/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739&ispcode=156 -> /http/180.96.143.76:6610/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739&ispcode=156 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Forwarded 374 bytes of headers to client 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Received all content (126 bytes) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Transfer complete 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Cleaning up session (socket=-1) 2026/09/02 22:27:10 INFO [Worker 0] New client 192.168.1.3:64749 requested URL: /http/180.96.143.76:6610/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739&ispcode=156 (method: GET) 2026/09/02 22:27:10 DEBUG [Worker 0] Host header validated: iptv.example.com 2026/09/02 22:27:10 DEBUG [Worker 0] Created HTTP proxy service: /http/180.96.143.76:6610/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739&ispcode=156 -> http://180.96.143.76:6610/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739&ispcode=156 2026/09/02 22:27:10 INFO [Worker 0] X-Forwarded-For accepted: 192.168.1.1 2026/09/02 22:27:10 DEBUG [Worker 0] Timezone: No TZ marker in User-Agent 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Parsed URL - host=180.96.143.76, port=6610, path=/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739&ispcode=156 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Connection to 180.96.143.76:6610 in progress (async, IPv4) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Async connection initiated 2026/09/02 22:27:10 INFO [Worker 0] HTTP Proxy: Connected to 180.96.143.76:6610 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Built request headers (362 bytes, body 0 bytes) for 180.96.143.76:6610/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1&IASHttpSessionId=RR1998320260902142710061739&ispcode=156 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Sent headers 362 bytes (362/362) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Request sent (362 headers + 0 body bytes) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Response status: 200 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Content-Type: application/vnd.apple.mpegurl 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Content-Length: 195 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: M3U content detected, will rewrite body 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Saved 209 bytes of response headers for rewrite 2026/09/02 22:27:10 DEBUG [Worker 0] M3U rewrite: 195 bytes -> 284 bytes 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Sent rewritten M3U (284 bytes body) 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Transfer complete 2026/09/02 22:27:10 DEBUG [Worker 0] HTTP Proxy: Cleaning up session (socket=-1)
原因找到了,
❯ curl -k -L
'https://iptv.example.com:port/http/gslb.itv.jsinfo.net:6060/00000002/01000000000003592955000012435088/index.m3u8?Playtype=1'
得到:
#EXTM3U
#EXT-X-STREAM-INF:PROGRAM-ID=1,BANDWIDTH=8192000
https://iptv.example.com/http/180.100.47.198:6610/00000002/01000000000003592955000012435088/8000_hls.m3u8?Playtype=1&IASHttpSessionId=RR1997920260903130858212801&m3u8_level=2&ispcode=156&ztecid=01000000000003592955000012435088
返回的m3u8不带端口号了。
找到的可能的原因:upstream-interface-http = en0加上就好了。目前看是它不跟随upstream-interface = en0了。