# protect rtsp stream

**URL:** <https://community.wowza.com/t/protect-rtsp-stream/39639>\
**Category:** Wowza Streaming Engine\
**Created:** [February 10, 2013, 1:12pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639 "2013-02-10T13:12:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 10, 2013, 1:12pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/1 "2013-02-10T13:12:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 10, 2013, 11:18pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/2 "2013-02-10T23:18:02Z")

</div>

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

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

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 11, 2013, 10:29pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/3 "2013-02-11T22:29:30Z")

</div>

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

[https://www.wowza.com/docs/media-security-overview](https://www.wowza.com/docs/media-security-overview)

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 11, 2013, 10:30pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/4 "2013-02-11T22:30:00Z")

</div>

Here is another option:

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

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 12, 2013, 12:14pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/5 "2013-02-12T12:14:09Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 12, 2013, 2:51pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/6 "2013-02-12T14:51:24Z")

</div>

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](https://www.wowza.com/docs/how-to-use-jw-player-with-wowza-streaming-engine) you would set the file: to

```auto
<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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 13, 2013, 1:01pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/7 "2013-02-13T13:01:28Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 13, 2013, 2:03pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/8 "2013-02-13T14:03:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 13, 2013, 2:14pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/9 "2013-02-13T14:14:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 13, 2013, 7:26pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/10 "2013-02-13T19:26:27Z")

</div>

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

Richard

---

<div class="post-metadata">

**Author:** ![Richard\_Lanham](https://avatars.discourse-cdn.com/v4/letter/r/c68b51/32.png) [@Richard\_Lanham](https://community.wowza.com/u/Richard_Lanham)\
**Post date:** [February 14, 2013, 9:29am UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/11 "2013-02-14T09:29:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Roman\_Pekarek](https://avatars.discourse-cdn.com/v4/letter/r/ac8455/32.png) [@Roman\_Pekarek](https://community.wowza.com/u/Roman_Pekarek)\
**Post date:** [February 11, 2013, 10:12pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/12 "2013-02-11T22:12:42Z")

</div>

rtsp ? or rtmp ?

---

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 11, 2013, 3:33am UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/13 "2013-02-11T03:33:56Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 11, 2013, 2:25pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/14 "2013-02-11T14:25:05Z")

</div>

rtmp

thx

---

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 11, 2013, 3:06pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/15 "2013-02-11T15:06:32Z")

</div>

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 -

---

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 11, 2013, 4:43pm UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/16 "2013-02-11T16:43:55Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 12, 2013, 6:36am UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/17 "2013-02-12T06:36:25Z")

</div>

where I must add this

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

I dont know where I must add

thx

---

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 12, 2013, 7:04am UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/18 "2013-02-12T07:04:08Z")

</div>

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,

---

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 12, 2013, 7:37am UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/19 "2013-02-12T07:37:26Z")

</div>

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**

---

<div class="post-metadata">

**Author:** ![povel\_remen](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@povel\_remen](https://community.wowza.com/u/povel_remen)\
**Post date:** [February 12, 2013, 10:38am UTC](https://community.wowza.com/t/protect-rtsp-stream/39639/20 "2013-02-12T10:38:39Z")

</div>

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 -

[Next page](https://community.wowza.com/t/protect-rtsp-stream/39639.md?page=2)
