# How do i stop people leeching my streams?

**URL:** <https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863>\
**Category:** Wowza Streaming Engine\
**Created:** [October 25, 2013, 4:12pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863 "2013-10-25T16:12:07Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [October 25, 2013, 4:12pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/1 "2013-10-25T16:12:07Z")

</div>

Is there anyway i can stop people leeching my streams at all?

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [October 25, 2013, 10:27am UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/2 "2013-10-25T10:27:46Z")

</div>

Have a look at this article:

[How to combat hotlinking your Adobe Flash SWF file](https://www.wowza.com/docs/how-to-combat-hotlinking-your-adobe-flash-swf-file)

Salvadore

---

<div class="post-metadata">

**Author:** ![Zoran](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/zoran/32/385_2.png) [@Zoran](https://community.wowza.com/u/Zoran)\
**Post date:** [October 28, 2013, 6:26pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/3 "2013-10-28T18:26:23Z")

</div>

Hi,

You will have to add the host name of the website hosting your player in this property as well:

domainLock

localhost,[mysite.com](http://mysite.com)

Zoran

---

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [October 25, 2013, 5:08pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/4 "2013-10-25T17:08:04Z")

</div>

Ive looked at that article and followed the instructions accept for the part about wirecast

domainLock

localhost,[mysite.com](http://mysite.com)

AllowEncoder

Wirecast

What is the proper method i have to input instead using wirecast i use Xsplit you see

---

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [October 25, 2013, 6:13pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/5 "2013-10-25T18:13:49Z")

</div>

So once ive filled in all the details on my application.xml how does that stop other sites leeching the stream exactly?

---

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [October 25, 2013, 9:05pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/6 "2013-10-25T21:05:14Z")

</div>

thats exactly what i mean i dont want my stream/swf file on other sites at all, but when i put the domain lock in and try to stream it doesnt allow me to

---

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [November 18, 2013, 2:04pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/7 "2013-11-18T14:04:23Z")

</div>

So is it the host name ONLY or my domain and my host name that i have to add??

---

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [November 18, 2013, 2:05pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/8 "2013-11-18T14:05:45Z")

</div>

Also when it says the saying “Compile this in the Wowza IDE” what does that actually mean as i dont understand it, how do i “Compile this in the Wowza IDE”

---

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [November 18, 2013, 2:42pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/9 "2013-11-18T14:42:19Z")

</div>

Also one last thing which Application.xml file needs editing as well please as theres more than 1 so is it the [install-dir]\conf \>\> The applicaion.xml file thats there or is it anywhere else?

So the 3 things i need answering is:

1. So is it the host name ONLY or my domain and my host name that i have to add??

2. when it says the saying “Compile this in the Wowza IDE” what does that actually mean as i dont understand it, how do i “Compile this in the Wowza IDE” as it says

“Here is a complete Wowza Module to deny hotlinking server-side. Compile this in the Wowza IDE:”

```auto
package com.wowza.wms.plugin.collection.module;
import com.wowza.wms.amf.*;
import com.wowza.wms.client.*;
import com.wowza.wms.module.*;
import com.wowza.wms.request.*;
public class ModuleHotlinkDenial extends ModuleBase {
	public void onConnect(IClient client, RequestFunction function,
			AMFDataList params) {
		
		getLogger().info("ModuleHotlinkDenial onConnect: " + client.getClientId());
  
		String flashver = client.getFlashVer().toLowerCase();
		getLogger().info("ModuleHotlinkDenial Client Flashver: " + flashver);
		
		try
		{ 
			String[] allowedEncoder = null;  
			    
			allowedEncoder = client.getAppInstance().getProperties().getPropertyStr("AllowEncoder","").toLowerCase().split(","); 
			if ( allowedEncoder != null )
				{ 
				for (int i = 0; i < allowedEncoder.length; i++) 
				{  
					if (flashver.startsWith(allowedEncoder[i].trim()) && allowedEncoder[i].length()>0) 
					{ 
						getLogger().info("ModuleHotlinkDenial Encoder Allowed: "+flashver+" matches "+allowedEncoder[i]); 
						client.acceptConnection();
						return;
					} 
				} 
			} 
		} 
		catch (Exception e) 
		{
			getLogger().info("ModuleHotlinkDenial Exception: " + e.getMessage()); 
		}
		boolean reject = true;
		String[] domainLocks = null;
		String[] domainUrl = null;;
			
		try 
		{ 
		domainLocks = client.getAppInstance().getProperties().getPropertyStr("domainLock").toLowerCase().split(",");
		String pageUrl = client.getProperties().getPropertyStr("connectpageUrl").toLowerCase();
		domainUrl = pageUrl.split("/");
		getLogger().info("domainLock: " + client.getAppInstance().getProperties().getPropertyStr("domainLock").toLowerCase());
		getLogger().info("pageUrl: " + pageUrl);
		for (int i = 0; i < domainLocks.length; i++)
		{ 
			if (domainLocks[i].trim().startsWith("*"))
			{
				String lock = domainLocks[i].trim().substring(1);
				if (domainUrl[2].endsWith(lock))
				{
					reject = false;
				}
			} 
			else if (domainUrl[2].equalsIgnoreCase(domainLocks[i].trim()))
			{
				reject = false; 
			}
		}
		} 
		catch(Exception ex)
		{
			reject = true;
		}
		if (reject)
		{
			getLogger().info("Client Rejected. IP: " + client.getIp());
			client.rejectConnection();
		}
	}
}

```

Where do i put the above code (like it says here: [https://www.wowza.com/docs/how-to-combat-hotlinking-your-adobe-flash-swf-file](https://www.wowza.com/docs/how-to-combat-hotlinking-your-adobe-flash-swf-file)) as i don’t understand what specific file i need to edit to put the above code in.

1. which Application.xml file needs editing as well please as theres more than 1 so is it the [install-dir]\conf \>\> The applicaion.xml file thats there or is it anywhere else?

So if someone could answer all 3 and when answering put like

1. answer …

2. answer…

3. …

i would be ever so grateful

Thanks guys really appreciate it!

---

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [November 18, 2013, 4:03pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/10 "2013-11-18T16:03:53Z")

</div>

> create a new class in eclipse called “ModuleHotlinkDenial”

Wheres ecplise and a new class how do i do that,

Sorry for the questions

---

<div class="post-metadata">

**Author:** ![david\_rees](https://avatars.discourse-cdn.com/v4/letter/d/49beb7/32.png) [@david\_rees](https://community.wowza.com/u/david_rees)\
**Post date:** [November 18, 2013, 5:39pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/11 "2013-11-18T17:39:57Z")

</div>

Got it now guys thanks ever so much!!

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [October 25, 2013, 11:42am UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/12 "2013-10-25T11:42:48Z")

</div>

The Value “FM” works in most cases. It is what the userAgent for FMLE 2.5, 3, 3.2 start with, and Wirecast and other encoders often use the same userAgent. If not, look in the access log and you see the userAgent of the encoder. Copy that to AllowEncoder Property Value.

Salvadore

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [October 25, 2013, 11:45am UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/13 "2013-10-25T11:45:40Z")

</div>

You might also want to look at this article and see what other options are available for protecting your stream:

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

Salvadore

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [October 25, 2013, 12:42pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/14 "2013-10-25T12:42:43Z")

</div>

Can you explain what you mean by “leeching” exactly?

The hotlink denial module denies other websites from hosting your .swf file on their website.

Depending on what you mean by “leeching” this might not be what you need.

You can find more info and other options for protecting your stream here:

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

Salvadore

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [November 18, 2013, 9:06am UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/15 "2013-11-18T09:06:51Z")

</div>

1. you can add as many “allowed domains” (comma separated) as you like, “locahost, [www.mysite.com](http://www.mysite.com)” would be your local computer and your website.

2. to compile the code, create a new class in eclipse called “ModuleHotlinkDenial” and past the code sample from the article:

[How to combat hotlinking your Adobe Flash SWF file](https://www.wowza.com/docs/how-to-combat-hotlinking-your-adobe-flash-swf-file)

Add the module to the Application.xml file, at the end of the modules list. Then in the IDE hit the green “run” button to compile the module and start Wowza.

Here is the Wowza IDE user guide, this will explain in much more detail how to do this:

[Wowza IDE User Guide](https://www.wowza.com/media-server/developers#wowza-ide)

1. The Application.xml file in [install-dir]/conf is the default Application.xml file, any edits made to this file will propagate to all other apps that use this file. When creating new applications it is advised to copy the default Application.xml file into the install/conf/[app] folder and edit the copied Application.xml file.

Salvadore

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [November 18, 2013, 10:09am UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/16 "2013-11-18T10:09:57Z")

</div>

The link I provided above to the Wowza IDE has a link to download Eclipse and also has the IDE User Guide.

Download and install Eclipse, then follow the IDE User Guide to start creating Wowza modules. The guide is very short and easy to follow, and will get you up and running very quickly.

Salvadore

---

<div class="post-metadata">

**Author:** ![sal\_jefferson](https://avatars.discourse-cdn.com/v4/letter/s/6de8d8/32.png) [@sal\_jefferson](https://community.wowza.com/u/sal_jefferson)\
**Post date:** [November 18, 2013, 12:06pm UTC](https://community.wowza.com/t/how-do-i-stop-people-leeching-my-streams/39863/17 "2013-11-18T12:06:15Z")

</div>

Great, thanks for the update. Glad we could help.

Salvadore
