mirror of
https://github.com/v0l/zap-stream-core.git
synced 2025-06-19 21:21:01 +00:00
Implement fingerprint-based viewer token generation using IP + user agent hashing (#4)
* Initial plan for issue * Implement fingerprint-based viewer token generation Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Fix bech32 encoding and add comprehensive tests Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> * Remove bech32 HRP and move dependencies to workspace Co-authored-by: v0l <1172179+v0l@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
This commit is contained in:
@ -71,8 +71,8 @@ impl HttpServer {
|
||||
api.track_viewer(token, stream_id, &client_ip, user_agent.clone());
|
||||
token.clone()
|
||||
} else {
|
||||
// Generate new viewer token
|
||||
let token = ViewerTracker::generate_viewer_token();
|
||||
// Generate new viewer token based on IP and user agent fingerprint
|
||||
let token = ViewerTracker::generate_viewer_token(&client_ip, user_agent.as_deref());
|
||||
api.track_viewer(&token, stream_id, &client_ip, user_agent);
|
||||
token
|
||||
};
|
||||
|
Reference in New Issue
Block a user