Indy 10.6.2 代理服务器和浏览器错误 ERR_HTTP2_PROTOCOL_ERROR

问题描述

我使用 (Delphi 10.4) 构建代理服务器应用程序侦听本地端口 8080,所有浏览器请求都通过我的代理服务器,但在很多情况下,浏览器会在控制台中抛出错误 ERR_HTTP2_PROTOCOL_ERROR .

OnBeforeCommand 事件代码

procedure TForm1.IdHTTPProxyServer1HTTPBeforeCommand(AContext: TIdHTTPProxyServerContext);
 var
SocksInfo: TIdSocksInfo;

  LURI: TIdURI;
  SSLClient: TIdSSLIOHandlerSocketopenSSL;
  tempProxy  : TIdConnectThroughHttpProxy ;
  tempIO : TIdSSLIOHandlerSocketopenSSL     ;

begin

    tempIO :=   TIdSSLIOHandlerSocketopenSSL.Create(AContext.OutboundClient);
    tempProxy :=   TIdConnectThroughHttpProxy.Create(AContext.OutboundClient);

    tempProxy.Enabled := False;    //False to go direct internet
    tempProxy.Host := '127.0.0.1';    //   disabled for Now
    tempProxy.Port := 8090 ;




  tempIO.SSLOptions.Mode       := sslmBoth;
  tempIO.SSLOptions.Method     := sslvSSLv23 ;
  tempIO.SSLOptions.SSLVersions:= [sslvSSLv2,sslvSSLv3,sslvTLSv1,sslvTLSv1_1,sslvTLSv1_2] ;
  tempIO.SSLOptions.VerifyMode := [];
  tempIO.SSLOptions.VerifyDepth := 0;

  tempIO.ReadTimeout           := 5000;


  //Events
  tempIO.OnStatus              := StausChange;
  tempIO.OnStatusInfo          := StatusInfo;
  tempIO.Passthrough           := True;
  tempIO.OnVerifyPeer          := OnVerifyPeer ;

  tempIO.Ongetpassword :=  Ongetpassword ;
  tempIO.OnStatusInfoEx := OnStatusInfoEx ;



    tempIO.TransparentProxy           :=   tempProxy ;
    AContext.OutboundClient.IOHandler :=  tempIO;



end;

我也使用了正确的 SSL 库 版本 1.0.2.18,那么为什么这个错误在浏览器控制台中反复出现?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)