472,145 Members | 1,474 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,145 software developers and data experts.

Creating a proxy...

Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 10 '06 #1
6 8526
you update the links to go thru your proxy.

ex:

<a href="http://microsoft.com">click</a>

becomes:

<a href="urlredir?http%3A//microsoft.com">click</a>

where urlredir is you remapper

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 10 '06 #2
I underestand that... But I don't have a separate web service or anything that is the proxy. The web control itself is the proxy. So how do I tell it to trigger a server side function in the web control? And still present as a hyperlink to the user?

Does that make sense?
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:ef**************@TK2MSFTNGP03.phx.gbl...
you update the links to go thru your proxy.

ex:

<a href="http://microsoft.com">click</a>

becomes:

<a href="urlredir?http%3A//microsoft.com">click</a>

where urlredir is you remapper

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 10 '06 #3
when they click on the link, it goes to your site for processing, then your site responds with a rediect to the real site, like any ad redirector.

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:u7**************@TK2MSFTNGP02.phx.gbl...
I underestand that... But I don't have a separate web service or anything that is the proxy. The web control itself is the proxy. So how do I tell it to trigger a server side function in the web control? And still present as a hyperlink to the user?

Does that make sense?
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:ef**************@TK2MSFTNGP03.phx.gbl...
you update the links to go thru your proxy.

ex:

<a href="http://microsoft.com">click</a>

becomes:

<a href="urlredir?http%3A//microsoft.com">click</a>

where urlredir is you remapper

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 10 '06 #4
The thing is, there is no site... It's a web part in a SharePoint page. The link needs to trigger a server side event within the web part. Either I'm missing something in the way you're suggesting I implement, or I'm not explaining it well enough.

I don't have a URL that I can redirect to. This is all happening within a control on a web page. The hosting web page can't be part of the process. Does that make sense?
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:e7**************@TK2MSFTNGP04.phx.gbl...
when they click on the link, it goes to your site for processing, then your site responds with a rediect to the real site, like any ad redirector.

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:u7**************@TK2MSFTNGP02.phx.gbl...
I underestand that... But I don't have a separate web service or anything that is the proxy. The web control itself is the proxy. So how do I tell it to trigger a server side function in the web control? And still present as a hyperlink to the user?

Does that make sense?
"bruce barker (sqlwork.com)" <b_*************************@sqlwork.comwrote in message news:ef**************@TK2MSFTNGP03.phx.gbl...
you update the links to go thru your proxy.

ex:

<a href="http://microsoft.com">click</a>

becomes:

<a href="urlredir?http%3A//microsoft.com">click</a>

where urlredir is you remapper

-- bruce (sqlwork.com)
<rl*****@newsgroups.nospamwrote in message news:%2****************@TK2MSFTNGP04.phx.gbl...
Here's the scenario. This is going to live in SharePoint, but it's an ASP/HTML issue I think. I need to be able to host an existing portlet in a sharepoint window. The trick is that I need to include some custom http headers in each request to the portlet app.

So, the initial request is easy... Just add the headers and make the request. But as the response comes back in, I need to look through it and see if any of the links are requests back to the portlet app. Those I need to intercept and add the custom headers to.

So as the response comes in, I can replace the href's in the stream, but what do I replace them with? What can I put int their place so that it maintains it look and feel as a hyperlink to the user, but will trigger a server side function call where I can add the custom headers in?

Any thoughts are greatly appreciated.

J
Nov 13 '06 #5
Hi rlrcstr,

I think it would be hard to do this without an additional handler that will
do an intermediate work at server-side. This is because in your webpart's
client-side html, we can only embed some basic url and querystring info,
but not add any custom httpheader.

If you want to send custom httprequest with custom headers, so far what I
can get is use XMLHTTP component to send http request(just like what AJAX
based page or control do):

#Posting Form Data and sending custom Request Headers with XMLHTTP
http://www.eggheadcafe.com/articles/20010510.asp

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 15 '06 #6
For this basic functionality, I think I've got somethign that works.

I can reaplace the hrefs with calls to javascript and hijack the
__dopostback function sending the requested URL as a parameter. Seems to
work fine in testing.

Thanks.

J

"Steven Cheng[MSFT]" <st*****@online.microsoft.comwrote in message
news:0z**************@TK2MSFTNGXA01.phx.gbl...
Hi rlrcstr,

I think it would be hard to do this without an additional handler that
will
do an intermediate work at server-side. This is because in your webpart's
client-side html, we can only embed some basic url and querystring info,
but not add any custom httpheader.

If you want to send custom httprequest with custom headers, so far what I
can get is use XMLHTTP component to send http request(just like what AJAX
based page or control do):

#Posting Form Data and sending custom Request Headers with XMLHTTP
http://www.eggheadcafe.com/articles/20010510.asp

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 17 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by William Ryan | last post: by
19 posts views Thread by Steve | last post: by
2 posts views Thread by Chamander2kool | last post: by
1 post views Thread by Jeevan | last post: by
16 posts views Thread by tshad | last post: by
reply views Thread by =?Utf-8?B?UlN1Yg==?= | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.