RTMP User and Password?

jmamoreira

New Member
Could someone give me a step-by-step where I activate/register on the server, username and password for rtmp transmission?

I read several topics, tried several methods, but anyone can still transmit to my Flashphoner AWS Server.

Thanks
 

Max

Administrator
Staff member
Good day.
You should pass authetication parameters in RTMP URL and parse them on a separate backend server using REST hooks. Please read details here.
 

jmamoreira

New Member
What I need is to register a username and password to stream, not to whatch. Now anyone with the address rmtp://mydomain.com:1935/live/xxxxx can transmitting to my server. For example, you can do the stream rmtp://mydomain.com:1935/live/yyyy in my server.

Anyone can do any live stream on my server for free.

I just want to leave the transmission with a password.

But for customers to watch free.

Temporarily I restricted the AWS Firewall to only my IP has access to port 1935, but it's annoying to have to change and it's not ideal.
 

Max

Administrator
Staff member
I just want to leave the transmission with a password.
A client should pass authetication parameters in RTMP URL rmtp://mydomain.com:1935/live?username=user&password=pwd/streamKey
To handle those parameters, you should use REST hook /connect. You backend server will receive a custom field with parameters passed, for example:
Code:
POST /rest/my_api/connect HTTP/1.1
Accept: application/json, application/*+json
Content-Type: application/json;charset=UTF-8
Host: 192.168.1.101
 
{
   "nodeId":"Hw47CFMBEchVOpBMDr29IxjudnJ1sjOY@192.168.1.101",
   "appKey":"defaultApp",
   "sessionId":"/192.168.1.102:60204/192.168.1.101:1935",
   "custom":{
        "username":"user",
        "password":"pwd"
   }
}
Your backend should respond 200 OK to allow RTMP publishing or 403 Forbidden to forbid.
Please look at the example of /connect REST hook implementation autoriziing publishers by domain. You can use the example as basis for our own backend script.
 
Top