# How to find out if a client is trying to publish a stream or play a stream?

**URL:** https://community.wowza.com/t/how-to-find-out-if-a-client-is-trying-to-publish-a-stream-or-play-a-stream/42707
**Category:** Wowza Developer Dojo
**Tags:** wowza-streaming-server-java-api
**Created:** [September 17, 2014, 4:31pm UTC](https://community.wowza.com/t/how-to-find-out-if-a-client-is-trying-to-publish-a-stream-or-play-a-stream/42707 "2014-09-17T16:31:14Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [September 17, 2014, 4:31pm UTC](https://community.wowza.com/t/how-to-find-out-if-a-client-is-trying-to-publish-a-stream-or-play-a-stream/42707/1 "2014-09-17T16:31:14Z")

</div>

Hi,

I am writing a custom Wowza module and I need to know in my “onConnect” method if the client that is connecting is trying to publish a stream or play a stream. The documentation (well, the generated javadoc…) is not clear to me about this. I want to support GoCoder and FMLE publishers too.

Can you help me how to solve this?

Thanks.

---

<div class="post-metadata">

### Author: ![system](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/system/32/447_2.png) [@system](https://community.wowza.com/u/system)
#### Post date: [September 18, 2014, 2:46pm UTC](https://community.wowza.com/t/how-to-find-out-if-a-client-is-trying-to-publish-a-stream-or-play-a-stream/42707/2 "2014-09-18T14:46:51Z")

</div>

Hi, answering partially my own question:

in the onConnect method it’s not possible, as it is called before any play or publish event. In my case implementing the “publish” method in my module does for FMLE and GoCoder running on Android, but I still haven’t found the solution for GoCoder on iPhone.

Unfortunately the lack of good quality documentation / example for the interface IAuthenticateRTSP or the method RTPClient.setAuthenticatePublishHandler(…) makes it difficult for me to go forward. Any help would be appreciated. So what I need is the ability to prevent GoCoder from iPhone from publishing based on certain conditions.

Thanks
