Skip to main content
Participant
December 25, 2013
Question

RTMPT custom headers

  • December 25, 2013
  • 1 reply
  • 599 views

Hello!

Please help me with RTMPT. Is there any way I can add custom header for each HTTP request to the server from player?

The point is, I want to forward EVERY HTTP request (POST /fcs/ident2, POST /open/1, POST /idle/session_id/0 and POST /send/session_id/n) from player by Java servlet based on info in these requests. And I can't find a way to put this additional info.

NetConnection.connect("rtmpt://host/servlet", "Custom Info") works but too late because "Custom Info" string is send only on first POST SEND. 

NetConnection.addHeader() does not seem to work cause Wireshark did not show me a new header. Or I used this method wrong.

Thank you

This topic has been closed for replies.

1 reply

sinious
Legend
December 26, 2013

I've have limited exposure to that but on the Java side are you extracting the header from the AMF format? The docs state it will be retained in every AMF packet sent as a header.

Just some open source server code to examine, note the onConnect method explicitly working with the AMF header data.

https://code.google.com/p/annuus/source/browse/trunk/src/com/ams/rtmp/net/NetConnection.java?r=402