Click here to Skip to main content
15,888,521 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: Use cases Pin
Ashfield18-May-09 1:14
Ashfield18-May-09 1:14 
Questionhow to view orginal address format in textbox (using datereader) Pin
JC.KaNNaN11-May-09 1:37
JC.KaNNaN11-May-09 1:37 
AnswerRe: how to view orginal address format in textbox (using datereader) Pin
Ashfield11-May-09 21:00
Ashfield11-May-09 21:00 
QuestionResizing an image Pin
Brendan Vogt10-May-09 1:25
Brendan Vogt10-May-09 1:25 
AnswerRe: Resizing an image Pin
Ashfield11-May-09 1:20
Ashfield11-May-09 1:20 
QuestionAdding a reference to a javascript file displays a blank webpage Pin
Brendan Vogt9-May-09 22:44
Brendan Vogt9-May-09 22:44 
AnswerRe: Adding a reference to a javascript file displays a blank webpage Pin
Abhishek Sur10-May-09 10:36
professionalAbhishek Sur10-May-09 10:36 
Questionhow do you setup a Http Proxy? [modified] Pin
devvvy9-May-09 16:38
devvvy9-May-09 16:38 
hello

how do you setup a Http Proxy?

The reason I'm asking is, I'm trying to use a AJAX/Javascript drag drop component from <a href="http://script.aculo.us/">http://script.aculo.us/</a>[<a href="http://script.aculo.us/" target="_blank" title="New Window">^</a>]

It makes call to for example localhost ShoppingCart.aspx using XMLHttpRequest. Now, while it's good with IE to fetch from say:
var url = 'http://localhost:3323/ASPNET_SERVICE/ShoppingCart.aspx';

For firefox, security prevents this. The get around is therefore:
var url = '/proxy?url=' + encodeURIComponent('http://localhost:3323/ASPNET_SERVICE/Default.aspx');

Now to do this first I need to setup a HttpProxy - but I have never done this before.

I browse around a bit and decided to try Privoxy. It's running now and I've configured both Firefox and IE to use proxy 127.0.0.1 8118 per instruction from <a href="http://www.privoxy.org/user-manual/quickstart.html">http://www.privoxy.org/user-manual/quickstart.html</a>[<a href="http://www.privoxy.org/user-manual/quickstart.html" target="_blank" title="New Window">^</a>]. For IE I also make sure "By-pass proxy server for local addresses" is UN-checked. I then point my browser to say www.msn.com - seems like whether browser always able to retrieve page whether I started (or stopped) the proxy. I expect if I stopped the proxy with IE setting configured to use it, I'd have connection problem of some sort ...

And also in AJAX request shouldn't there be a parameter where you NEED to specify proxy enable/disable and proxy port? Using Prototype (http://www.prototypejs.org/api/ajax/options)
<code>
var myAjax = new Ajax.Request( url, {method: 'get', parameters: pars, onLoading: showLoad, onComplete: showResponse} );
</code>
(Example from: http://www.ajaxlessons.com/2006/02/1...scriptaculous/)

Or using vanilla javascript:
<code>
var url="gethint.asp";
url=url+"?q="+str;
url=url+"&amp;sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
</code>

The biggest problem I have now is that if I use "/proxy" in my HttpRequest url - i.e.
<code>
var url = '/proxy?url=' + encodeURIComponent('http://localhost/JavascriptAJAXTest/Default.aspx');
// Instead of: var url = 'http://localhost:3323/ASPNET_SERVICE/Default.aspx';
</code>
then I get <b>"HTTP 404 - File not found"</b> - I checked the resource it's definitely there.

<a href="http://localhost/JavascriptAJAXTest/Default.aspx">http://localhost/JavascriptAJAXTest/Default.aspx</a>[<a href="http://localhost/JavascriptAJAXTest/Default.aspx" target="_blank" title="New Window">^</a>]

I checked IIS Log:
<br />
05:29:15 127.0.0.1 - W3SVC1 LAPPC2 127.0.0.1 80 GET /proxy url=http%3A%2F%2Flocalhost%2FJavascriptAJAXTest%2FDefault.aspx?product_id=product_2&rand=0.5694375981715101 404 2 4184 606 16 HTTP/1.0 localhost Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.1;+SV1;+.NET+CLR+3.0.04506.648;+.NET+CLR+3.5.21022;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729) - http://localhost/Javascript/script.aculo.us/scriptaculous-js-1.8.2/SimpleDragDropTest.html<br />


I then pointed my browser at:
http://localhost/JavascriptAJAXTest/Default.aspx?product_id=product_2&rand=0.5694375981715101

The page is certainly there.

Thanks


REF:
http://www.prototypejs.org/api/ajax/request[^]
http://www.xml.com/pub/a/2005/11/09/fixing-ajax-xmlhttprequest-considered-harmful.html[^]

Privoxy
Download: http://sourceforge.net/project/showfiles.php?group_id=11118
User Manual: http://www.privoxy.org/user-manual/index.html
General: http://www.privoxy.org/

dev

modified on Sunday, May 10, 2009 1:32 AM

QuestionTable not centering in Firefox Pin
Brendan Vogt9-May-09 3:52
Brendan Vogt9-May-09 3:52 
AnswerRe: Table not centering in Firefox Pin
Brendan Vogt9-May-09 3:56
Brendan Vogt9-May-09 3:56 
QuestionJavascript To Control Page Using JoyStick Pin
Yadav Akash7-May-09 19:41
Yadav Akash7-May-09 19:41 
AnswerRe: Javascript To Control Page Using JoyStick Pin
Abhijit Jana7-May-09 21:24
professionalAbhijit Jana7-May-09 21:24 
GeneralRe: Javascript To Control Page Using JoyStick Pin
Yadav Akash13-May-09 0:49
Yadav Akash13-May-09 0:49 
Questionincrease z index for a button/link in a div Pin
Yogesh Jamkhindikar6-May-09 12:00
Yogesh Jamkhindikar6-May-09 12:00 
QuestionWeb Reference HELP!!! Pin
bytecrusader6-May-09 6:37
bytecrusader6-May-09 6:37 
Questiondeveloper of this site Pin
mdazeemuddin6-May-09 4:18
mdazeemuddin6-May-09 4:18 
AnswerRe: developer of this site Pin
Dalek Dave6-May-09 4:41
professionalDalek Dave6-May-09 4:41 
JokeRe: developer of this site Pin
Vasudevan Deepak Kumar7-May-09 21:16
Vasudevan Deepak Kumar7-May-09 21:16 
AnswerRe: developer of this site Pin
Abhijit Jana7-May-09 21:22
professionalAbhijit Jana7-May-09 21:22 
AnswerRe: developer of this site Pin
I Sam Asir Aloysious11-May-09 20:32
I Sam Asir Aloysious11-May-09 20:32 
QuestionESB Pin
ATM@CodeProject6-May-09 2:09
ATM@CodeProject6-May-09 2:09 
QuestionClick event is not working when a onblur is throwing an alert Pin
Arun Kumar Babu5-May-09 20:21
Arun Kumar Babu5-May-09 20:21 
AnswerRe: Click event is not working when a onblur is throwing an alert Pin
Marc Firth5-May-09 22:17
Marc Firth5-May-09 22:17 
QuestionSimple Jscript/asp validation Pin
rentzk5-May-09 17:57
rentzk5-May-09 17:57 
AnswerRe: Simple Jscript/asp validation Pin
boarderstu11-May-09 0:55
boarderstu11-May-09 0:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.