# Get request parameters in onConnect event

**URL:** <https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634>\
**Category:** Wowza Streaming Engine\
**Created:** [June 1, 2009, 9:25am UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634 "2009-06-01T09:25:44Z")\
**Posts on this page:** 9\
**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:** [June 1, 2009, 9:25am UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/1 "2009-06-01T09:25:44Z")

</div>

Hi All,

I am using a url (with parameters) to request live rtp streams: rtmp://IP/rtplive/live.sdp?param1=val1&param2=val2.

In the onConnect I can use the client.getUri() to get the basic application part, but I did not find how can I get the rest of the URL.

I did find that if implementing the play method I can use the params.get(PARAM1) to get the information, but I prefer to do it in the onConnect (the parameters are use for authentication and I want to reject the connection in the onConnect).

Thanks in advance for your help,

Hanan.

---

<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:** [June 1, 2009, 11:00am UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/2 "2009-06-01T11:00:01Z")

</div>

You can extract params in onConnect too:

Flash:

```auto
netconnection.connnect("rtmp://IP/rtplive",val1,val2);

```

Wowza:

```auto
public void onConnect(IClient client, RequestFunction function,
			AMFDataList params) {
String val1 = getParamString(params,PARAM1);
String val2 = getParamString(params,PARAM2);		 
	}

```

Richard

---

<div class="post-metadata">

**Author:** ![Charlie\_Good](https://sea2.discourse-cdn.com/flex002/user_avatar/community.wowza.com/charlie_good/32/383_2.png) [@Charlie\_Good](https://community.wowza.com/u/Charlie_Good)\
**Post date:** [June 1, 2009, 3:50am UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/3 "2009-06-01T03:50:34Z")

</div>

Actually these parameters are more likely attached to the stream and not the connection. So the only way to intercept them is in the play command. So you need to do something like:

```auto
public void play(IClient client, RequestFunction function, AMFDataList params)
{
	IMediaStream stream = getStream(client, function);
	String queryStr = stream.getQueryStr();
	invokePrevious(client, function, params);
}

```

Charlie

---

<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:** [June 1, 2009, 11:35am UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/4 "2009-06-01T11:35:52Z")

</div>

Try this:

```auto
client.getQueryStr();

```

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:** [April 7, 2010, 6:25pm UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/5 "2010-04-07T18:25:02Z")

</div>

For JW Player 5.1, try this:

flashvars=“streamer=rtmp://192.168.1.1/vod&file=mp4:test.mp4?key=129841&provider=rtmp”

For JW Player 4.\*, try this:

flashvars=“streamer=rtmp://192.168.1.1/vod&file=mp4:test.mp4?key=129841&type=rtmp”

Richard

---

<div class="post-metadata">

**Author:** ![Hanan\_Hermon](https://avatars.discourse-cdn.com/v4/letter/h/43a26b/32.png) [@Hanan\_Hermon](https://community.wowza.com/u/Hanan_Hermon)\
**Post date:** [June 1, 2009, 1:14pm UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/6 "2009-06-01T13:14:06Z")

</div>

Hi Richard,

Thanks for the response, but unfortunately it dose not help me.

The way my client works is just providing the full URL and not using netconnection to pass the parameters.

Please advise,

Hanan.

---

<div class="post-metadata">

**Author:** ![Hanan\_Hermon](https://avatars.discourse-cdn.com/v4/letter/h/43a26b/32.png) [@Hanan\_Hermon](https://community.wowza.com/u/Hanan_Hermon)\
**Post date:** [June 1, 2009, 1:47pm UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/7 "2009-06-01T13:47:52Z")

</div>

Again thanks, but still not working (it returns an empty string).

Hanan

---

<div class="post-metadata">

**Author:** ![no\_no](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@no\_no](https://community.wowza.com/u/no_no)\
**Post date:** [April 7, 2010, 9:41am UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/8 "2010-04-07T09:41:04Z")

</div>

I tested the latest code but it still returns empty string.

Here’s my flashvar for JW Player

```auto
 flashvars="streamer=rtmp://192.168.1.1/vod&file=mp4:test.mp4?key=129841"

```

---

<div class="post-metadata">

**Author:** ![no\_no](https://avatars.discourse-cdn.com/v4/letter/n/3ab097/32.png) [@no\_no](https://community.wowza.com/u/no_no)\
**Post date:** [April 7, 2010, 10:44am UTC](https://community.wowza.com/t/get-request-parameters-in-onconnect-event/634/9 "2010-04-07T10:44:55Z")

</div>

getQueryStr returns empty string with the latest flashvar.

I just noticed that this is for WMS 1.7. I’m on WMS 2.0.

However, I noticed that a code from this thread :

[https://www.wowza.com/forums/showthread.php?t=6876](https://www.wowza.com/forums/showthread.php?t=6876)

is passing querystring to streamName as well, so all is good.

Thanks
