Lazarus

Programming => Networking and Web Programming => Topic started by: awaked2 on June 14, 2021, 05:57:24 am

Title: synapse THTTPSend socks5 problem?
Post by: awaked2 on June 14, 2021, 05:57:24 am
hello i'm newbie! i have a question.

Code: Pascal  [Select][+][-]
  1.  
  2.   response := TStringStream.Create('');
  3.   http := THTTPSend.Create;
  4.   http.UserAgent := 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; WOW64; Trident/7.0';
  5.   http.MimeType := 'application/x-www-form-urlencoded; charset=UTF-8';
  6.   http.Sock.SocksIP := 'IP'; //
  7.   http.Sock.SocksPort := '1080';
  8.   http.Sock.SocksType := ST_Socks5;
  9.   http.Sock.SocksUsername := 'UserName'; //
  10.   http.Sock.SocksPassword := 'Password'; //
  11.   http.Sock.ConnectionTimeout := 6000;
  12.   jsontext := EncodeURL('Some JSON Data');
  13.  
  14.   WriteStrToStream(HTTP.Document, jsontext);
  15.   http.HTTPMethod('POST', 'http://.....'); // HTTP site
  16.   reulstcode := http.resultcode;                                  
  17.  

windows10 => resultcode 200 (work)
raspberry pi4 raspbian 32bit => resultcode 500 (not work)

Same code, but only works on Windows.
If I remove the socks5 proxy option it works on Raspbian too.
But why doesn't socks5 work on Raspbian?
Title: Re: synapse THTTPSend socks5 problem?
Post by: BeniBela on June 14, 2021, 04:23:00 pm
Probably this bug: https://sourceforge.net/p/synalist/bugs/48/

It is been fixed in SVN trunk
Title: Re: synapse THTTPSend socks5 problem?
Post by: awaked2 on June 14, 2021, 05:38:10 pm
//Port := IntToStr(ResolvePort(Port));

Thank you for answer. I removed that line, but it doesn't work......
Title: Re: synapse THTTPSend socks5 problem?
Post by: sstvmaster on June 14, 2021, 08:28:58 pm
synapse svn trunk -> https://sourceforge.net/p/synalist/code/HEAD/tree/trunk/
Title: Re: synapse THTTPSend socks5 problem?
Post by: awaked2 on June 14, 2021, 10:19:59 pm
I tried installing with the r222 version and it still doesn't work.
Title: Re: synapse THTTPSend socks5 problem?
Post by: awaked2 on June 14, 2021, 11:13:53 pm
Socks5 does not work even with Indy. I don't know why. Maybe this is the problem?
SocksIP := 'proxy-nl.service.com' // domain not work?
TinyPortal © 2005-2018