httpproxy authentication & agent simulation
runrev at animabit.de
runrev at animabit.de
Thu Apr 17 05:24:15 EDT 2008
Hello Mark Smith
thank you very much for your tipp using HTTPHeaders for implementing another User-Agent!
In the archives I found with the help of Mark Schonewille
http://www.mail-archive.com/metacard@lists.runrev.com/msg09789.html
From: Dave Cragg <dcragg at ...>
Subject: Re: HTTPProxy - authenticated proxy servers supported?
Date: 2003-08-21 09:33:29
with information how to use proxy authentication.
The solution in both cases uses HTTPHeaders. I try to set the HTTPHeaders to a multiline string
"User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)"
& cr &
<put proxyusername into tID
put proxypassword into tPass
put base64Encode(tID & ":" & tPass) into tString
set the httpHeaders to "Proxy-Authorization:" && tString>
& other Headerinformation
Perhaps I can avoid the shell(Perl-journey) and stay in runrev even in this case. Thank you.
Nice day,
Franz
Mit freundlichen Grüßen
Franz Böhmisch
boehmisch at animabit.de
http://www.animabit.de
GF Animabit Multimedia Software GmbH
Am Sonnenhang 22
D-94136 Thyrnau
Tel +49 (0)8501-8538
Fax +49 (0)8501-8537
----------------------------------------------------
httpproxy authentication & agent simulation
Mark Smith mark at maseurope.net
Wed Apr 16 13:12:36 CDT 2008
Franz, you can spoof the user-agent using another httpHeader:
set the httpHeaders to "User-Agent: Mozilla/4.0 (compatible; MSIE
6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)" --
or somesuch, this will override the default user-agent.
I'm pretty sure you can do http authentication with a header too,
using the "WWW-Authenticate:" header, but I'm not sure exactly what
form it takes.
Hope this helps,
Mark
On 16 Apr 2008, at 18:26, runrev at animabit.de wrote:
> Hello,
>
> 1.
> I need fileupload from runrev via http using a proxy. This works with
>
> on mouseUp
> answer file "Which file ... Welche Datei soll auf den Server
> geladen werden?"
> set httpproxy to "http://proxy:8080"
> put it into dateiname
> set the itemdelimiter to "/"
> put the last item of dateiname into shortname
> put dateiname && "wird aufgeladen ..." into field "protokoll"
> put libUrlMultipartFormData(tForm, "pdftitel",
> shortname,"submit","Datei auf Server hochladen!") into tData
> set the httpheaders to line 1 of tForm
> delete line 1 of tForm
> put libUrlMultipartFormAddPart(tForm, "filename","<file>" &
> dateiname, "multipart/form-data", "binary") into tData
> put "http://htaccessusername:htaccesspassword@server.de/upload.cgi"
> into tURL
> post tForm to url tUrl
> set the htmltext of field "protokoll" to it
> end mouseUp
>
>
> 2. But the proxy (http) needs
> a) authentication
> and perhaps
> b) only allows Mozilla or IE compatible browsers for http access.
>
> Now I have written a workaround in Perl:
>
>
>
> use LWP::UserAgent;
> my $ua = LWP::UserAgent->new;
> ...
> $ua->proxy(['http', 'ftp'], 'http://
> proxyusername:proxypassword at proxy:8080/');
> $ua->agent("Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1;
> SV1; .NET CLR 1.1.4322)");
>
> ...
> which allows http-upload through a proxy with authentication and
> agent simulation.
>
> 3. Question
>
> Is it possible to define httpproxy authentication & agent
> simulation? Then I must not use Perl for a workaround ...
>
More information about the use-livecode
mailing list