# Using StreamNameAlias module

**URL:** <https://community.wowza.com/t/using-streamnamealias-module/37885>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [April 27, 2012, 9:07am UTC](https://community.wowza.com/t/using-streamnamealias-module/37885 "2012-04-27T09:07:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Daniel\_Mahoney1](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@Daniel\_Mahoney1](https://community.wowza.com/u/Daniel_Mahoney1)\
**Post date:** [April 27, 2012, 9:07am UTC](https://community.wowza.com/t/using-streamnamealias-module/37885/1 "2012-04-27T09:07:43Z")

</div>

One of my clients wants to limit the stream names that his application will accept for streaming. I’m trying to accomplish this with the StreamNameAlias module. My understanding from reading the docs is that adding the appropriate entries to conf/aliasmap.stream.txt will do what I want.

I’ve edited that file and removed the wildcard entry. I’ve tried adding a line that looks like:

stream1=${Stream.Name}

and found that I can still send any stream name with no problem. I then replaced that with a line that read:

stream1=stream1

but again found that I could send any stream name I want. I’m obviously misunderstanding how to make use of this module and how to build the aliasmap file.

Any pointers? For example, if I only want my application to accepts streams with stream names of “stream1”, “stream2”, or “stream3”, how would I go about achieving that short of writing a custom module?

---

<div class="post-metadata">

**Author:** ![Daniel\_Mahoney1](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@Daniel\_Mahoney1](https://community.wowza.com/u/Daniel_Mahoney1)\
**Post date:** [April 27, 2012, 10:14am UTC](https://community.wowza.com/t/using-streamnamealias-module/37885/2 "2012-04-27T10:14:23Z")

</div>

One more point: in looking at the documentation for the MediaSecurity module and the StreamNameAlias module, both of them say to insert the appropriate module as the last entry in the section. Obviously only one of them can be last. Can I safely assume that it doesn’t matter too much which module is last in the list and which is last but one?

---

<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:** [May 1, 2012, 12:27pm UTC](https://community.wowza.com/t/using-streamnamealias-module/37885/3 "2012-05-01T12:27:13Z")

</div>

Or take a look at the StreamNameAlias API

[https://www.wowza.com/docs/how-to-use-the-imediastreamnamealiasprovider2-interface](https://www.wowza.com/docs/how-to-use-the-imediastreamnamealiasprovider2-interface)

Richard

---

<div class="post-metadata">

**Author:** ![Lisa\_Wong](https://avatars.discourse-cdn.com/v4/letter/l/34f0e0/32.png) [@Lisa\_Wong](https://community.wowza.com/u/Lisa_Wong)\
**Post date:** [April 27, 2012, 4:01pm UTC](https://community.wowza.com/t/using-streamnamealias-module/37885/4 "2012-04-27T16:01:57Z")

</div>

I would put the Media Security authentication module last.

Regarding your stream name alias question, besides setting up your aliasmap.stream.txt file, did you also add the corresponding configuration to your Application.xml?

-Lisa

---

<div class="post-metadata">

**Author:** ![Daren\_Johnson](https://avatars.discourse-cdn.com/v4/letter/d/ee59a6/32.png) [@Daren\_Johnson](https://community.wowza.com/u/Daren_Johnson)\
**Post date:** [April 30, 2012, 3:30pm UTC](https://community.wowza.com/t/using-streamnamealias-module/37885/5 "2012-04-30T15:30:07Z")

</div>

Hi,

It does sound like you don’t want to allow a stream at all if it does not fit the name requirement, correct?

If this is the case, then StreamNameAlias isn’t really what you want, and some custom work will be necessary.

Take a look at the code example in this post, it does sound close to what you need:

[https://www.wowza.com/forums/showthread.php?17097-Stop-live-streamname](https://www.wowza.com/forums/showthread.php?17097-Stop-live-streamname)

and can certainly be adapted.

Daren

---

<div class="post-metadata">

**Author:** ![Daniel\_Mahoney1](https://avatars.discourse-cdn.com/v4/letter/d/b5e925/32.png) [@Daniel\_Mahoney1](https://community.wowza.com/u/Daniel_Mahoney1)\
**Post date:** [April 30, 2012, 1:45pm UTC](https://community.wowza.com/t/using-streamnamealias-module/37885/6 "2012-04-30T13:45:16Z")

</div>

> I would put the Media Security authentication module last.
> 
> Regarding your stream name alias question, besides setting up your aliasmap.stream.txt file, did you also add the corresponding configuration to your Application.xml?
> 
> -Lisa

Yep. I’ve currently got RTMPAuthenticate before StreamNameAlias; I’ll give it a try the other way around.

My current Application.xml contains:

ModuleRTMPAuthenticate

ModuleRTMPAuthenticate

com.wowza.wms.plugin.security.ModuleRTMPAuthenticate

ModulesStreamNameAlias

ModuleStreamNameAlias

com.wowza.wms.plugin.streamnamealias.ModuleStreamNameAlias

aliasMapFileStream

${com.wowza.wms.context.VHostConfigHome}/conf/aliasmap.stream.txt

aliasMapFilePlay

${com.wowza.wms.context.VHostConfigHome}/conf/aliasmap.play.txt

aliasMapPathDelimiter

/

aliasMapNameDelimiter

=

aliasMapDebug

true

Boolean

The aliasmap.stream.txt I tried most recently contains:

#\*=${Stream.Name}

stream1=${Stream.Name}

stream2=${Stream.Name}

but doesn’t limit the allowed stream names. I’ll swap the last two Modules entries and see if that makes a difference.
