protect rtsp stream

I want protect ym stream from wowza with user and paswd, how can I do it, like

rtsp://username:password@:127.0.0.1:1935/live/mystream

thx

Set the /conf/live/Application.xml /RTP /Authentication /PlayMethod to “basic”

Then add usernames and passwords to the /conf/publish.password file.

Richard

For RTMP you need ModuleSecureToken, or ModuleSecureURLParams. Take a look at the Security Overview:

https://www.wowza.com/docs/media-security-overview

Richard

Here is another option:

https://www.wowza.com/docs/how-to-do-file-based-rtmp-authentication-with-url-query-strings-onconnectauthenticate2

Richard

The last one I showed will work for querystring:

https://www.wowza.com/docs/how-to-do-file-based-rtmp-authentication-with-url-query-strings-onconnectauthenticate2

rtmp://127.0.0.1:1935/live?friend1&friend1/tv.stream

If you are using the Module Collection, make sure you re-start Wowza after adding the .jar file.

Richard

If you are developing a player you can do it in ActionScript. If you are using a player like JW Player or Flowplayer you can do it in the HTML container where the rtmp url is set. Add the querystring after the application part, not after the stream name. For example in JW Player 6 you would set the file: to

<html>
<head>
<title>JW Player 6</title>
<script type="text/javascript" src="/jwplayer/jwplayer.js" ></script>
<script>jwplayer.key="[jwplayer-key]"</script>
</head>
<body>
<div id="player">Loading the player...</div>
<script type="text/javascript">
    jwplayer("player").setup({
   	sources: [{
            file: "rtmp://[wowza-address]:1935/live?friend1&friend1/tv.stream"
        },{
            file: "http://[wowza-address]:1935/live?friend&friend1/tv.stream/playlist.m3u8"
        }]
    });
</script>
</body>
</html>

Richard

Again, ModuleRTMPAuthenticate is not what you need in this case. You can use this:

https://www.wowza.com/docs/how-to-do-file-based-rtmp-authentication-with-url-query-strings-onconnectauthenticate2

You ask where to put the netconnection.connect, which indicates that you are not working with the actioncscript of a Flashplayer. Therefore you have to add the user info querystring to the HTML page that loads your player and where you set the rtmp url. I showed an example using JW Player.

Hope that helps.

Richard

Restart Wowza, then test start the live stream and test playback with these querystring variables.

Then zip up and send /conf and /logs folders to support@wowza.com. Include a link to this thread for reference.

It is important to re-start Wowza before the above test.

Richard

Also, meanwhile, can you show the RTMP url with querystring that you used when this error occurred? It looks like the querystring was not in the right place or did not have both values.

Richard

It’s the first one. The other two will not work with this and will result in the error you showed

Richard

I suggested you re-start Wowza, run through the tests and zip up and send /conf and /logs folders to support@wowza.com. Did you do that?

Richard

rtsp ? or rtmp ?

I can not connect

my stream

rtmp://username:password@:127.0.0.1:1935/live/tv.stream

in player I have message

can not play media file

but stream

rtmp://:127.0.0.1:1935/live/tv.stream

still going

I cange next line in conf/liveAplication,xml

digest

basic

thx

rtmp

thx

nothin

INFO server comment - LiveStreamPacketizerCupertino.endChunkTS[live/definst/ftv.stream]: Add chunk: id:10 mode:TS[H264,AAC] a/v/

k:138/240/3 duration:9599

INFO session connect-pending 88.146.190.254 -

INFO server comment - size: 3

ERROR server comment - ModuleOnConnectAuthenticate.onConnect: java.lang.ArrayIndexOutOfBoundsException: 1

INFO session connect 88.146.190.254 -

INFO session disconnect 1706780801 -

INFO server comment - LiveStreamPacketizerCupertino.endChunkTS[live/definst/ftv.stream]: Add chunk: id:11 mode:TS[H264,AAC] a/v/

k:169/294/4 duration:11761

INFO session connect-pending 88.146.190.254 -

INFO server comment - size: 3

ERROR server comment - ModuleOnConnectAuthenticate.onConnect: java.lang.ArrayIndexOutOfBoundsException: 1

INFO session connect 88.146.190.254 -

INFO session disconnect 1275818787 -

INFO session connect-pending 88.146.190.254 -

INFO server comment - size: 3

ERROR server comment - ModuleOnConnectAuthenticate.onConnect: java.lang.ArrayIndexOutOfBoundsException: 1

INFO session connect 88.146.190.254 -

INFO session disconnect 1928809594 -

I must ask again:

I want protect stream link from wowza out. When anosther user want watch channel from wowza, I need set user and paswd on stream which go out from wowza

for examle

my stream from wowza:

rtmp://:127.0.0.1:1935/live/tv.stream

This channel link I give you ym frineds, and I want that every my frieend have user and paswd, like:

rtmp://friend1:friend1@:127.0.0.1:1935/live/tv.stream

rtmp://friend2:friend2@:127.0.0.1:1935/live/tv.stream

rtmp://friend3:friend3@:127.0.0.1:1935/live/tv.stream

etc

I’m tired of this,Whatever you do, nothing.

I used this method:

https://www.wowza.com/docs/how-to-enable-username-password-authentication-for-rtmp-and-rtsp-publishing

  1. wms-plugin-security.jar copy in /lib

  2. aded this module , edit Application.xml in [install-dir]/conf

ModuleRTMPAuthenticate

ModuleRTMPAuthenticate

com.wowza.wms.security.ModuleRTMPAuthenticate

  1. in publish.password I aded user paswd, like

friend1 friend1

friend2 friend2

  1. copy publish.password in /conf/live

5.aded this properties, edit Application.xml in [install-dir]/conf

rtmpEncoderAuthenticateFile

${com.wowza.wms.context.VHostConfigHome}/conf/${com.wowza.wms.context.Application}/publish.password

when I try

rtmp://friend1:friend1@:127.0.0.1:1935/live/tv.stream

or

rtmp://127.0.0.1:1935/live/tv.stream?friend1&friend1

or

rtmp://127.0.0.1/live/tv.stream?friend1&friend1

big nothing

do you can instruct me about this

thx

where I must add this

netconnection.connect(“rtmp://[wowza-address]/[app-name]?user1&pass1”);

I dont know where I must add

thx

I watch tihis on potplayer, there is not problme.

Please answer me

where I must add this

netconnection.connect(“rtmp://[wowza-address]/[app-name]?user1&pass1”);

is that I must add in aplication.xml or another place

p.s

I use wowza 3.5 and from WowzaServerAddOnCollection I copy only /lib/wms-plugin-collection.jar in /lib wowza. Did I need copy other file in WowzaServerAddOnCollection in wowza.

Whey I copy wms-plugin-collection.jar in /lib wowza and change apl.xml with zhis

  1. aded this module , edit Application.xml in [install-dir]/conf

ModuleRTMPAuthenticate

ModuleRTMPAuthenticate

com.wowza.wms.security.ModuleRTMPAuthentica te

again nothig

rtmp://127.0.0.1:1935/live?friend1&friend1/tv.stream

this link not ready in my potplayer,

I copy this in /conf/live/aplication.xml on last place in module:

base

Base

com.wowza.wms.module.ModuleCore

properties

Properties

com.wowza.wms.module.ModuleProperties

logging

Client Logging

com.wowza.wms.module.ModuleClientLogging

flvplayback

FLVPlayback

com.wowza.wms.module.ModuleFLVPlayback

moduleOnConnectAuthenticate2

ModuleOnConnectAuthenticate2

com.wowza.wms.plugin.collection.module.ModuleOnConnectAuthenticate2

layable on older iPhone and iPod touch devices where Baseline/Level 3.0 or lower is required) Video info: {H264CodecConfigInfo: co

dec:H264, profile:Main, level:3.0, frameSize:720x576, displaySize:720x576, frameRate:25.0, PAR:1:1}

INFO server comment - LiveStreamPacketizerCupertino.handlePacket[live/definst/tv.stream][mp4a.40.2]: AAC Audio info: {AACFrame:

codec:AAC, channels:2, frequency:44100, samplesPerFrame:1024, objectType:LC}

INFO server comment - LiveStreamPacketizerSmoothStreaming.handlePacket[live/definst/tv.stream]: Fragment durations: [0.0,0.0,0.

0]

INFO server comment - LiveStreamPacketizerSmoothStreaming.addFragment[live/definst/tv.stream]: Add chunk: type:video id:2 count

:125 duration:0

INFO session connect-pending 32.176.192.22 -

INFO server comment - size: 3

INFO session connect 32.176.192.22 -

INFO session disconnect 1254566181 -