# Simplest way to redirect RTMP connection to another server?

**URL:** <https://community.wowza.com/t/simplest-way-to-redirect-rtmp-connection-to-another-server/33647>\
**Category:** Wowza Developer Dojo\
**Tags:** wowza-streaming-server-java-api\
**Created:** [March 19, 2012, 4:54pm UTC](https://community.wowza.com/t/simplest-way-to-redirect-rtmp-connection-to-another-server/33647 "2012-03-19T16:54:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dave\_adams](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dave\_adams](https://community.wowza.com/u/dave_adams)\
**Post date:** [March 19, 2012, 4:54pm UTC](https://community.wowza.com/t/simplest-way-to-redirect-rtmp-connection-to-another-server/33647/1 "2012-03-19T16:54:18Z")

</div>

I’m looking for the easiest way to redirect an RTMP connection request to another server. Something as simple as this would be great:

[https://www.wowza.com/docs/how-to-do-server-side-redirect-of-rtmp-connections-from-one-application-to-another](https://www.wowza.com/docs/how-to-do-server-side-redirect-of-rtmp-connections-from-one-application-to-another)

I realize that the above code is only for redirecting to other applications and NOT for redirecting to another server, so it didn’t surprise me that changing the “appUrl” property produced the following error:

_Exception in thread “VHostHandler.defaultVHost.6” java.lang.Error: Unresolved compilation problem:_

_appUrl cannot be resolved_

The change I made was:

tcUrlStr = tcUrlStr.replace(appUrl,"[new\_server]");

connectObj.put(“tcUrl”, new AMFDataItem("[new\_server]"));

connectObj.put(“tcUrl”, new AMFDataItem(tcUrlStr));

I’m guessing that the LoadBalancer code has an example of how to redirect RTMP connections but I’m having trouble finding it amid the other functionality in those 5 source files.

Is there a simple way to redirect RTMP connection requests to another server? or can you point me to the specific function inside the LoadBalancer code?

---

<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:** [March 19, 2012, 11:58pm UTC](https://community.wowza.com/t/simplest-way-to-redirect-rtmp-connection-to-another-server/33647/2 "2012-03-19T23:58:12Z")

</div>

Look at the NetConnection redirect method in the included guide. This uses 302 redirect method. An example Flash client is included in the package, and JW player & Flowplayer both support this with no mods.

Richard

---

<div class="post-metadata">

**Author:** ![dave\_adams](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dave\_adams](https://community.wowza.com/u/dave_adams)\
**Post date:** [March 19, 2012, 5:10pm UTC](https://community.wowza.com/t/simplest-way-to-redirect-rtmp-connection-to-another-server/33647/3 "2012-03-19T17:10:09Z")

</div>

Ah yes, thank you!
