diff options
author | sommerfeld <sommerfeld@sommerfeld.dev> | 2024-06-29 22:47:40 +0100 |
---|---|---|
committer | sommerfeld <sommerfeld@sommerfeld.dev> | 2024-06-29 22:47:40 +0100 |
commit | 651a2ce19012f112439a46716637307b052dd150 (patch) | |
tree | f53d7f4bb0df663a5a1db76f02afb044ef14fb0f /src/main.rs | |
parent | e04bb1ce54726df9a90c10d3040d90529d8da235 (diff) | |
download | viewercount-651a2ce19012f112439a46716637307b052dd150.tar.gz viewercount-651a2ce19012f112439a46716637307b052dd150.tar.bz2 viewercount-651a2ce19012f112439a46716637307b052dd150.zip |
Fix HLS viewer count computation
It was making a list of the local socket addresses instead of the remote
ones and then uninquing and counting it, which always resulted in 1
viewer.
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index e82cfee..bcbd969 100644 --- a/src/main.rs +++ b/src/main.rs @@ -294,7 +294,7 @@ fn get_https_connected_ips() -> Result<Vec<IpAddr>> { .chain(procfs::net::tcp6()?) .filter_map(|t| { if t.local_address.port() == 443 && t.state == TcpState::Established { - return Some(t.local_address.ip()); + return Some(t.remote_address.ip()); } None }) |