Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » NetProxy package. (HTTP/SOCKS4/4a/5 with BIND support) encapsulation for U++
Re: NetProxy package. (HTTP/SOCKS4/4a/5 with BIND support) encapsulation for U++ [message #54197 is a reply to message #48812] Sat, 06 June 2020 23:04 Go to previous messageGo to previous message
Oblivion is currently offline  Oblivion
Messages: 1223
Registered: August 2007
Senior Contributor
Hi,

NetProxy package has received a small update. (Minor bug fixes.)

Also, I've added two simple Socks5 connection examples to upp-components/Examples directory:
SocksProxyExample     - Demonstrates a simple SOCKS5 connection, using NetProxy package.
SocksProxyExampleNB   - Demonstrates a simple, non-blocking SOCKS5 connection, using NetProxy package.



SocksProxyExample:

#include <Core/Core.h>
#include <NetProxy/NetProxy.h>

using namespace Upp;

// This example demonstrates the basic usage of NetProxy class with socks5 tunnels.
// Default proxy server: Turk Telekom, a well-known ISP in Turkey. No auth required...
// Target server: test.rebex.net -> A well-known FTP/SFTP test server.

CONSOLE_APP_MAIN
{
	StdLogSetup(LOG_COUT|LOG_FILE);
	NetProxy::Trace();
	
	const char *proxy_server = "88.249.26.113";
	const int   proxy_port   = 1080;

	TcpSocket sock;

	NetProxy socksproxy(sock, proxy_server, proxy_port);
	if(socksproxy.Timeout(10000).Socks5().Connect("test.rebex.net", 21)) {
		RLOG("-------------");
		RLOG(sock.GetLine());	// Get the first line of FTP server HELO...
		RLOG("-------------");
		return;
	}
	RLOG(socksproxy.GetErrorDesc());
}


If you have any questions, let me know.

Best regards,
Oblivion


[Updated on: Sat, 06 June 2020 23:07]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Request for adding GraphCtrl to UppHub
Next Topic: A terminal emulator widget for U++
Goto Forum:
  


Current Time: Thu Aug 14 19:03:56 CEST 2025

Total time taken to generate the page: 0.13716 seconds