sergey-dryabzhinsky / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
1.02k stars 215 forks source link

Double **&&** at call=connect #317

Closed git001 closed 3 years ago

git001 commented 3 years ago

I have seen in the on_connect notification that the addr field have an addition & which looks wrong.

call=connect&app=camera01&flashver=FMLE/3.0%20(compatible%3B%20Lavf58.59&swfurl=&tcurl=rtmps://DOMAIN:1936/camera01&pageurl=&epoch=150958994&&addr=IP&clientid=3835

It's only when call=connect and only after epoch which I have seen from tshark output.

I assume that this line could be the reason but I'm not sure because I don't know the code at all.

https://github.com/sergey-dryabzhinsky/nginx-rtmp-module/blob/dev/ngx_rtmp_notify_module.c#L547

sergey-dryabzhinsky commented 3 years ago

I think that reasone in behaviour of ngx_rtmp_netcall_http_format_session. On connect event there not all params are present. And request string produced wrong formated. I'll try to rewrite that code.

sergey-dryabzhinsky commented 3 years ago

Last code from branch issue-317-fix-double-ampersand-in-event-request. I got that data via ffplay call through php:

REQUEST=connect; POST={"call":"connect","app":"rtmp","flashver":"LNX 9,0,124,2","swfurl":"","tcurl":"rtmp:\\/\\/localhost:1935\\/rtmp","pageurl":"","epoch":"324785757","addr":"127.0.0.1","clientid":"10"}; RAW POST: call=connect&app=rtmp&flashver=LNX%209,0,124,2&swfurl=&tcurl=rtmp://localhost:1935/rtmp&pageurl=&epoch=324785757&addr=127.0.0.1&clientid=10
REQUEST=play; GET=[]; POST={"call":"play","name":"live","start":"4294965296","duration":"0","reset":"0","addr":"127.0.0.1","clientid":"10","app":"rtmp","flashver":"LNX 9,0,124,2","tcurl":"rtmp:\\/\\/localhost:1935\\/rtmp"}
REQUEST=disconnect; POST={"call":"disconnect","bytes_in":"368","bytes_out":"412","addr":"127.0.0.1","clientid":"10","app":"rtmp","flashver":"LNX 9,0,124,2","tcurl":"rtmp:\\/\\/localhost:1935\\/rtmp"}; RAW POST: call=disconnect&bytes_in=368&bytes_out=412&addr=127.0.0.1&clientid=10&app=rtmp&flashver=LNX%209,0,124,2&tcurl=rtmp://localhost:1935/rtmp
REQUEST=play-done; GET=[]; POST={"call":"play_done","name":"live","bytes_in":"368","bytes_out":"412","addr":"127.0.0.1","clientid":"10","app":"rtmp","flashver":"LNX 9,0,124,2","tcurl":"rtmp:\\/\\/localhost:1935\\/rtmp"}
sergey-dryabzhinsky commented 3 years ago

If you want to try it - look at #331 PR.

sergey-dryabzhinsky commented 3 years ago

Merged into dev.