ossrs / srs

SRS is a simple, high-efficiency, real-time video server supporting RTMP, WebRTC, HLS, HTTP-FLV, SRT, MPEG-DASH, and GB28181.
https://ossrs.io
MIT License
24.7k stars 5.28k forks source link

HLS Multiple Connections from same IP #4098

Closed raphael-ba closed 1 week ago

raphael-ba commented 1 week ago

Describe the bug It's not a real "bug" I just noticed something strange. OSSRS opens Steam on HLS, everything works without any problems. But what I noticed is that with some clients (I noticed it with TVHeadend and Kodi) there are several connections from the same IP connected to the same user Agend. However, only one is actively watching at any one time, the others do not see any outgoing traffic. This distorts the statistics of users who are watching, because clients who are not actively watching are also counted.

Version v6.0-d4

To Reproduce Steps to reproduce the behavior:

  1. Start srs Server with HLS
  2. Go to APi URL http://streamserver.url:1985/api/v1/clients
  3. Check connected clients send_bytes and recv_bytes

Expected behavior Perhaps there is a timeout for Nginx that kicks clients that are connected for longer than a certain time and do not request data from the server.

Screenshots Here is an example for a connected client

   {
      "id": "xxxxx",
      "vhost": "xxxxx",
      "stream": "vid-xxxx",
      "ip": "x.x.x.x",
      "pageUrl": "TVHeadend/4.3-2323~g73a6bd00d",
      "swfUrl": "",
      "tcUrl": "http://stream.url/live",
      "url": "stream.url/live/stream",
      "name": "stream.m3u8",
      "type": "hls-play",
      "publish": false,
      "alive": 288.12,
      "send_bytes": 0,
      "recv_bytes": 0,
      "kbps": {
        "recv_30s": 0,
        "send_30s": 0
      }

Additional context