Creating a proxy...

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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)
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
 
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?
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)
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
 
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)
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?
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)
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
 
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?
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)
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?
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)
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
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top