1. http_get behind a proxy
- Posted by papinic Jun 24, 2011
- 2664 views
Hello everybody,
I'm trying to retrive a web page using http_get:
url = "http://www.google.com" txt_url = http_get(url) if atom(txt_url) or length(txt_url) = 0 then error = 1 end if
but when I use this at work, I'm behind a proxy server and I get an error.
How can I solve this?
Thanks,
papinic
2. Re: http_get behind a proxy
- Posted by papinic Jun 25, 2011
- 2514 views
I found
[proc] set_http_proxy_mode ( atom http, atom on )
in wxEuphoria. Can it help me?
4. Re: http_get behind a proxy
- Posted by jeremy (admin) Jul 19, 2011
- 2349 views
http_get does not have proxy support as of now, sorry.
Jeremy
5. Re: http_get behind a proxy
- Posted by papinic Aug 07, 2011
- 2276 views
Ok, so I tried with wget. The code I am using is:
system("wget -q -O " & "temp.html \"" & url & "\"", 0) return {0, read_file("temp.html")}
but each call to wget makes a black console screen flash. Is there any way to avoid the black screen?
Also I noticed that http_get (also without proxy) causes my application to stop, without any evidence in ex.err. I am using euphoria 4.0.3.
Thanks.
Papinic
6. Re: http_get behind a proxy
- Posted by useless Aug 10, 2011
- 2254 views
What is the address of your proxy and the port number?
useless
7. Re: http_get behind a proxy
- Posted by useless Aug 10, 2011
- 2214 views
Write a .bat file such as:
set http_proxy=http://ip-number:port-number/ c:\wget\wget.exe -k --connect-timeout=60 -nc -PE:\asubdir\ -oE:\log-this4.txt -w60 -Dsomedomain.com -x --user-agent="Mozilla/3.0" -e robots=off http://somedomain.com/path/filename.htmlthen do something like
sleep(1) junk = system_exec(YourBatFileName,2)
then read the file into your program.
useless
8. Re: http_get behind a proxy
- Posted by papinic Aug 28, 2011
- 2038 views
Thanks, it works.
But, is there a way to avoid the black screen and to execute the command in background?
9. Re: http_get behind a proxy
- Posted by jeremy (admin) Aug 29, 2011
- 1997 views
Does anyone understand the internals of how http proxies work that could modify the code to allow http proxy support directly in Euphoria?
Jeremy
10. Re: http_get behind a proxy
- Posted by m_sabal Aug 29, 2011
- 1988 views
Euphoria's socket library is based on my eunet project. The eunet_get_http function accepted 3 arguments: IP address, hostname, and file name. Normally, the IP address is the resolved address of hostname; but in the case of a proxy, it would the the IP address:port of the proxy. I don't know if the socket library still has enough of the eunet internals to support this.
11. Re: http_get behind a proxy
- Posted by jeremy (admin) Aug 29, 2011
- 1930 views
Euphoria's socket library is based on my eunet project. The eunet_get_http function accepted 3 arguments: IP address, hostname, and file name. Normally, the IP address is the resolved address of hostname; but in the case of a proxy, it would the the IP address:port of the proxy. I don't know if the socket library still has enough of the eunet internals to support this.
OK. So if I understand this right the only thing we would need to do is provide a 3rd option to http_get that is an address of a proxy server and then connect to that IP address (if supplied) and then just pass on the normal GET request? That sounds easy enough, is that the case? I'll code it up and have it ready for 4.1.
Jeremy
12. Re: http_get behind a proxy
- Posted by jeremy (admin) Aug 29, 2011
- 2045 views
Hello everybody,
I'm trying to retrive a web page using http_get:
url = "http://www.google.com" txt_url = http_get(url) if atom(txt_url) or length(txt_url) = 0 then error = 1 end if
but when I use this at work, I'm behind a proxy server and I get an error.
How can I solve this?
Thanks,
papinic
Can you backup your existing EUDIR/include/net/http.e and replace it with http://scm.openeuphoria.org/hg/euphoria/file/eac268f96290/include/std/net/http.e ? Then use the new method: set_proxy_server(ip, port) and let me know how that works out?
Jeremy
13. Re: http_get behind a proxy
- Posted by papinic Sep 01, 2011
- 1897 views
Hi Jeremy,
thank you for your interest in this problem. On Monday I'll be back to work and I'll check your solution.
Papinic
14. Re: http_get behind a proxy
- Posted by jeremy (admin) Sep 01, 2011
- 1813 views
thank you for your interest in this problem. On Monday I'll be back to work and I'll check your solution.
Thanks!
Jeremy
15. Re: http_get behind a proxy
- Posted by jimcbrown (admin) Sep 03, 2011
- 1874 views
Euphoria's socket library is based on my eunet project. I don't know if the socket library still has enough of the eunet internals to support this.
Although true at one point in time, I'm pretty sure this is no longer the case, considering that most of the socket library is written in C and additionally that Jeremy rewrote all or most of http.e
16. Re: http_get behind a proxy
- Posted by papinic Sep 05, 2011
- 1826 views
No way...
I think the problem is that the proxy needs authentication... is there a way to pass username and password?
17. Re: http_get behind a proxy
- Posted by jeremy (admin) Sep 05, 2011
- 1793 views
No way...
I think the problem is that the proxy needs authentication... is there a way to pass username and password?
My tests with the new library method works with anonymous proxies. I am not sure how to interact with an authenticating proxy. I'll have to do some research.
Jeremy