delphi - Operator not applicable to this operand type+Socks+SSL -


trying proxy stuff, error : operator not applicable operand type , used visual component before , good, changed code this..code below.

  var      lhttp: tidhttp;     idssl: tidssliohandlersocketopenssl;     socks : tidsocksinfo;     host, port : string;   begin     try     lhttp := tidhttp.create(nil);     idssl := tidssliohandlersocketopenssl.create(lhttp);         lhttp.readtimeout := 60000;        idssl.ssloptions.sslversions := [sslvtlsv1, sslvtlsv1_1, sslvtlsv1_2];        idssl.ssloptions.mode := sslmclient;       idssl.transparentproxy := socks.create(lhttp);        (idssl.transparentproxy socks).port := port.tointeger(); //error       (idssl.transparentproxy socks).host := host;            //error        (idssl.transparentproxy socks).version := svsocks5;  //error        lhttp.iohandler := idssl;       lhttp.handleredirects := true;     end; 

your typecasts wrong, why getting errors. need cast type, not variable name:

(idssl.transparentproxy tidsocksinfo).port := port.tointeger; (idssl.transparentproxy tidsocksinfo).host := host; (idssl.transparentproxy tidsocksinfo).version := svsocks5; 

a better option use variable have declared, , don't use typecasts @ all:

socks := socks.create(lhttp); socks.port := port.tointeger; socks.host := host; socks.version := svsocks5; idssl.transparentproxy := socks; 

Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -