FAskUseHttpProxy: boolean;
FProxyPort: integer;
FProxyAddress: String;
+ FProxyNeedAuthentication: boolean;
+ FProxyUser: String;
+ FProxyPass: String;
FConfirmOnExit: boolean;
FFixMessySurface: boolean;
FResetIfGhostAfterSend: boolean;
procedure SetLogWindowDividerPos(const Value: integer);
procedure SetProxyAddress(const Value: String);
procedure SetProxyPort(const Value: integer);
+ procedure SetProxyUser(const Value: String);
+ procedure SetProxyPass(const Value: String);
+ procedure SetProxyNeedAuthentication(const Value: boolean);
procedure SetUseHttpProxy(const Value: boolean);
procedure SetAskUseHttpProxy(const Value: boolean);
procedure SetConfirmOnExit(const Value: boolean);
property AskUseHttpProxy: boolean read FAskUseHttpProxy write SetAskUseHttpProxy;
property ProxyAddress: String read FProxyAddress write SetProxyAddress;
property ProxyPort: integer read FProxyPort write SetProxyPort;
+ property ProxyUser: String read FProxyUser write SetProxyUser;
+ property ProxyPass: String read FProxyPass write SetProxyPass;
+ property ProxyNeedAuthentication: boolean read FProxyNeedAuthentication write SetProxyNeedAuthentication;
//\8dÄ\90Ú\91±
property ReconnectWait: integer read FReconnectWait write SetReconnectWait;
//\83\8d\83O\83E\83B\83\93\83h\83E\8aÖ\8cW
AskUseHttpProxy := FIni.ReadBool('System', 'AskUseHttpProxy', false);
ProxyAddress := FIni.ReadString('System', 'ProxyAddress', '');
ProxyPort := FIni.ReadInteger('System', 'ProxyPort', 0);
+ ProxyUser := FIni.ReadString('System', 'ProxyUser', '');
+ ProxyPass := FIni.ReadString('System', 'ProxyPass', '');
+ ProxyNeedAuthentication := FIni.ReadBool('System', 'ProxyNeedAuthentication', false);
//
ReconnectWait := FIni.ReadInteger('System', 'ReconnectWait', 6);
//\83\8d\83O\83E\83B\83\93\83h\83E\8aÖ\8cW
FProxyPort := Value;
end;
+procedure TBottlePrefs.SetProxyNeedAuthentication(const Value: boolean);
+begin
+ FProxyNeedAuthentication := Value;
+end;
+
+procedure TBottlePrefs.SetProxyPass(const Value: String);
+begin
+ FProxyPass := Value;
+end;
+
+procedure TBottlePrefs.SetProxyUser(const Value: String);
+begin
+ FProxyUser := Value;
+end;
+
procedure TBottlePrefs.SetResetIfGhostAfterSend(const Value: boolean);
begin
FResetIfGhostAfterSend := Value;
FIni.WriteBool('System', 'AskUseHttpProxy', AskUseHttpProxy);
FIni.WriteString('System', 'ProxyAddress', ProxyAddress);
FIni.WriteInteger('System', 'ProxyPort', ProxyPort);
+ FIni.WriteBool('System', 'ProxyNeedAuthentication', ProxyNeedAuthentication);
+ FIni.WriteString('System', 'ProxyUser', ProxyUser);
+ FIni.WriteString('System', 'ProxyPass', ProxyPass);
//
FIni.WriteInteger('System', 'ReconnectWait', ReconnectWait);
//
FRecvString: String;
FProxyServer: String;
FProxyPort: integer;
+ FProxyUser: String;
+ FProxyPass: String;
FOnSuccess: TNotifyEvent;
FOnConnectionFailed: TNotifyEvent;
FLastErrorMessage: String;
FTriggerWorkEventBy: integer;
procedure SetProxyPort(const Value: integer);
procedure SetProxyServer(const Value: String);
+ procedure SetProxyUser(const Value: String);
+ procedure SetProxyPass(const Value: String);
procedure SetOnConnectionFailed(const Value: TNotifyEvent);
procedure SetOnSuccess(const Value: TNotifyEvent);
procedure SetOnHttpWork(const Value: THttpWorkEvent);
property RecvString: String read FRecvString;
property ProxyServer: String read FProxyServer write SetProxyServer;
property ProxyPort: integer read FProxyPort write SetProxyPort;
+ property ProxyUser: String read FProxyUser write SetProxyUser;
+ property ProxyPass: String read FProxyPass write SetProxyPass;
property OnConnectionFailed: TNotifyEvent read FOnConnectionFailed write SetOnConnectionFailed;
property OnSuccess: TNotifyEvent read FOnSuccess write SetOnSuccess;
property OnHttpWork: THttpWorkEvent read FOnHttpWork write SetOnHttpWork;
Http.Host := FHost;
Http.ProxyParams.ProxyServer := ProxyServer;
Http.ProxyParams.ProxyPort := ProxyPort;
+
+ if ProxyUser <> '' then begin
+ if ProxyPass <> '' then begin
+ Http.ProxyParams.BasicAuthentication := true;
+ Http.ProxyParams.ProxyUsername := ProxyUser;
+ Http.ProxyParams.ProxyPassword := ProxyPass;
+ end;
+ end;
+
Http.OnWork := WorkHandler;
if FPost = '' then begin
FRecvString := Http.Get(FURL);
raise EIdException.Create('Tried to change proxy without suspending');
end;
+procedure THTTPDownloadThread.SetProxyUser(const Value: String);
+begin
+ if Suspended then
+ FProxyUser := Value
+ else
+ raise EIdException.Create('Tried to change proxy without suspending');
+end;
+
+procedure THTTPDownloadThread.SetProxyPass(const Value: String);
+begin
+ if Suspended then
+ FProxyPass := Value
+ else
+ raise EIdException.Create('Tried to change proxy without suspending');
+end;
+
procedure THTTPDownloadThread.SetTriggerWorkEventBy(const Value: integer);
begin
FTriggerWorkEventBy := Value;
if Pref.UseHttpProxy then begin
FHttpThread.ProxyServer := Pref.ProxyAddress;
FHttpThread.ProxyPort := Pref.ProxyPort;
+ if Pref.ProxyNeedAuthentication then begin
+ FHttpThread.ProxyUser := Pref.ProxyUser;
+ FHttpThread.ProxyPass := Pref.ProxyPass;
+ end;
end;
FHttpThread.FreeOnTerminate := true;
FHttpThread.OnSuccess := HttpSuccess;
IdSlpp20.Host := Pref.ProxyAddress;
IdSlpp20.Port := Pref.ProxyPort;
IdSlpp20.ProxyMode := true;
- IdSlpp20.ProxyUser := '';
- IdSlpp20.ProxyPass := '';
+ if Pref.ProxyNeedAuthentication then begin
+ IdSlpp20.ProxyUser := Pref.ProxyUser;
+ IdSlpp20.ProxyPass := Pref.ProxyPass;
+ end else begin
+ IdSlpp20.ProxyUser := '';
+ IdSlpp20.ProxyPass := '';
+ end;
end else begin
IdSlpp20.Host := Pref.BottleServer;
IdSlpp20.Port := Pref.BottleServerPort;
if Pref.UseHttpProxy then begin
FHttp.ProxyServer := Pref.ProxyAddress;
FHttp.ProxyPort := Pref.ProxyPort;
+ if Pref.ProxyNeedAuthentication then begin
+ FHttp.ProxyUser := Pref.ProxyUser;
+ FHttp.ProxyPass := Pref.ProxyPass;
+ end;
end;
FHttp.OnSuccess := HttpSuccess;
FHttp.OnConnectionFailed := HttpFailure;
Top = 32
Width = 440
Height = 291
- ActivePage = tstGeneral
+ ActivePage = tstConnection
Anchors = [akLeft, akTop, akRight, akBottom]
MultiLine = True
TabOrder = 0
TabVisible = False
object lblReconnectWait: TLabel
Left = 8
- Top = 168
+ Top = 216
Width = 156
Height = 12
Caption = #20877#25509#32154#12434#35430#12415#12427#12414#12391#12398#20998#25968'(&R):'
Left = 8
Top = 8
Width = 417
- Height = 145
+ Height = 193
Caption = 'HTTP Proxy'#35373#23450
TabOrder = 0
object lblProxyAddress: TLabel
Left = 16
- Top = 92
+ Top = 84
Width = 56
Height = 12
Caption = #12450#12489#12524#12473'(&D)'
end
object lblProxyPort: TLabel
Left = 16
- Top = 116
+ Top = 108
Width = 47
Height = 12
Caption = #12509#12540#12488'(&O)'
Font.Style = []
ParentFont = False
end
+ object Label2: TLabel
+ Left = 16
+ Top = 164
+ Width = 48
+ Height = 12
+ Caption = #12518#12540#12470#21517
+ end
+ object Label3: TLabel
+ Left = 216
+ Top = 164
+ Width = 54
+ Height = 12
+ Caption = #12497#12473#12527#12540#12489
+ end
object edtProxyAddress: TEdit
Left = 80
- Top = 88
+ Top = 80
Width = 257
Height = 20
Hint = 'Proxy'#12469#12540#12496#12398#12450#12489#12524#12473
end
object edtProxyPort: TEdit
Left = 80
- Top = 112
+ Top = 104
Width = 81
Height = 20
Hint = 'Proxy'#12469#12540#12496#12398#12509#12540#12488#30058#21495
end
object cbxAskUseHttpProxy: TCheckBox
Left = 16
- Top = 64
+ Top = 56
Width = 305
Height = 17
Hint = #12463#12521#12452#12450#12531#12488#36215#21205#26178#12395#12289'Proxy'#12434#21033#29992#12377#12427#12363#12393#12358#12363#30906#35469#12375#12414#12377
Caption = #36215#21205#26178#12395'Proxy'#12434#21033#29992#12377#12427#12363#12393#12358#12363#12383#12378#12397#12427'(&A)'
TabOrder = 3
end
+ object cbxProxyNeedAuthentication: TCheckBox
+ Left = 16
+ Top = 136
+ Width = 273
+ Height = 17
+ Hint = #35469#35388#12364#24517#35201#12394'Proxy'#12434#21033#29992#12377#12427#22580#21512#12395#12481#12455#12483#12463#12375#12414#12377#12290#36890#24120#12399#12481#12455#12483#12463#12377#12427#24517#35201#12399#12354#12426#12414#12379#12435#12290
+ Caption = #12371#12398'Proxy'#12399#35469#35388#12364#24517#35201
+ TabOrder = 4
+ end
+ object edtProxyUser: TEdit
+ Left = 80
+ Top = 160
+ Width = 121
+ Height = 20
+ Hint = 'Proxy'#12469#12540#12496#12398#12518#12540#12470#21517
+ TabOrder = 5
+ end
+ object edtProxyPass: TEdit
+ Left = 280
+ Top = 160
+ Width = 121
+ Height = 20
+ Hint = 'Proxy'#12469#12540#12496#12398#12497#12473#12527#12540#12489
+ TabOrder = 6
+ end
end
object spnReconnectWait: TSpinEdit
Left = 168
- Top = 164
+ Top = 212
Width = 57
Height = 21
Hint = #28961#36890#20449#29366#24907#12391#20877#25509#32154#12434#35430#12415#12427#12414#12391#12398#20998#25968#12290#36890#24120#12399#22793#26356#12377#12427#24517#35201#12399#12394#12356
ReplacePresetList: TfrmReplacePresetList;
cbxAskUseHttpProxy: TCheckBox;
cbxNoWarnOfEmptyFMO: TCheckBox;
+ cbxProxyNeedAuthentication: TCheckBox;
+ edtProxyUser: TEdit;
+ edtProxyPass: TEdit;
+ Label2: TLabel;
+ Label3: TLabel;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure edtProxyPortKeyPress(Sender: TObject; var Key: Char);
procedure ctvBottleNodeChecked(Sender: TObject;
//
cbxUseHttpProxy.Checked := Pref.UseHttpProxy;
cbxAskUseHttpProxy.Checked := Pref.AskUseHttpProxy;
+ cbxProxyNeedAuthentication.Checked := Pref.ProxyNeedAuthentication;
edtProxyAddress.Text := Pref.ProxyAddress;
edtProxyPort.Text := IntToStr(Pref.ProxyPort);
+ edtProxyUser.Text := Pref.ProxyUser;
+ edtProxyPass.Text := Pref.ProxyPass;
//
spnReconnectWait.Value := Pref.ReconnectWait;
//
Pref.AskUseHttpProxy := cbxAskUseHttpProxy.Checked;
Pref.ProxyAddress := edtProxyAddress.Text;
Pref.ProxyPort := StrToInt(edtProxyPort.Text);
+ Pref.ProxyUser := edtProxyUser.Text;
+ Pref.ProxyPass := edtProxyPass.Text;
+ Pref.ProxyNeedAuthentication := cbxProxyNeedAuthentication.Checked;
//
Pref.ReconnectWait := spnReconnectWait.Value;
//