微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。