Autor Beitrag
DELPHIn
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Windows Vista
Delphi 2007 für Win 32 Prof.
BeitragVerfasst: Mo 29.07.02 16:07 
Hi,
ich möchte mit meinem Prog über einen Proxy aufs Internet zugreifen.
Ich stelle NMHTTP.Proxy und NMHTTP.ProxyPort ein, dann läuft es!
Aber wenn der Proxy einen Benutzernamen und ein Passwort verlangt, wie übergebe ich das?

_________________
DELPHIn
=> Errare humanum est
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mo 29.07.02 17:59 
Hallo,

leider kann ich dir keine direckte Antwort gaben. Fakt ist, das diese Funktion erst ab Socks 5 unterstützt wird. Wenn die Fastnetkomponenten das nicht unterstützen geht es nicht. Ich weiß, das die Indy 8 Kompos das können. Als ich mir das letzte mal die Indy 9 Betta angeguckt habe war die Socks impementierung so gut wie nicht vorhanden.

Gruß
Klabautermann
DELPHIn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Windows Vista
Delphi 2007 für Win 32 Prof.
BeitragVerfasst: Mi 31.07.02 15:10 
Gibt es denn keine Möglichkeit, dass mit Standartkompos zu tun?

_________________
DELPHIn
=> Errare humanum est
Klabautermann
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Veteran
Beiträge: 6366
Erhaltene Danke: 60

Windows 7, Ubuntu
Delphi 7 Prof.
BeitragVerfasst: Mi 31.07.02 15:33 
DELPHIn hat folgendes geschrieben:
Gibt es denn keine Möglichkeit, dass mit Standartkompos zu tun?


Vieleicht ist das ein Grund aus dem Indy ab Delphi 6 die Standartkomponenten sind. Die Fastnet Kompos wurden ja auch "nur" von Borland dazulizensiert.

Gruß
Klabautermann
M4EiB
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 41



BeitragVerfasst: Mi 31.07.02 18:38 
hi

du musst in den header folgende zeile schreiben:
Proxy-Authorization: Basic user:password

wobei das user:password erst mit einer base64-routine codiert werden muss. eine solche findest du bei torry oder in der indy-komponenten sammlung.

jetzt frag mich aber nicht wie man mit nmhttp eine zeile in den header einfügt.

mfg M4EiB
DELPHIn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Windows Vista
Delphi 2007 für Win 32 Prof.
BeitragVerfasst: Mi 31.07.02 19:23 
M4EiB hat folgendes geschrieben:

jetzt frag mich aber nicht wie man mit nmhttp eine zeile in den header einfügt.

Das ist nicht das Problem, mehr Sorgen macht mir da das Codieren, dass habe ich noch nicht gemacht.

Werd' ich gleich morgen probieren!

Danke

_________________
DELPHIn
=> Errare humanum est
DELPHIn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Windows Vista
Delphi 2007 für Win 32 Prof.
BeitragVerfasst: Do 01.08.02 07:46 
OK, das Codieren war nicht das Problem, aber das mit dem Header bekomme ich doch nicht hin :oops: .
Hat sowas schonmal jemand gemacht?

Codiert habe ich mit der Base64-Indy Compo.

_________________
DELPHIn
=> Errare humanum est
DELPHIn Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 98

Windows Vista
Delphi 2007 für Win 32 Prof.
BeitragVerfasst: So 04.08.02 21:13 
Ich hab' jetzt die Lösung:
Bevor die Anfrage raus geht, wird NMHTTP1AboutToSend abgearbeitet.
Hier schreibt man dann folgendes rein:

ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
procedure TUpdate.NMHTTP1AboutToSend(Sender: TObject);
var a : string;
begin
  a := EditUser.Text + ':' + EditPass.Text;
  a := IdBase64Encoder1.CodeString(a);
  NMHTTP1.SendHeader.Values['Proxy-Authorization'] := a;
end;


Ist denke ich mal selbsterklärend. Zwei Edit-Kompos zur Eingabe von UserId und Passwort und die Indy-Kompo IdBase64Encoder.

_________________
DELPHIn
=> Errare humanum est
fbkreon
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 50



BeitragVerfasst: So 27.10.02 15:34 
Und wie mache ich dem jetzt noch klar, daß er über eine spezielle Adresse die Verbindung auf bauen soll?
Also wenn der Proxy z.B. 192.168.1.205 hat oder so?
Denn die Prozedur NMHTTP1AboutToSend sagt das ja nicht aus....