This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void Proxy() | |
{ | |
var tcpListener = new TcpListener(IPAddress.Loopback, 9000); | |
tcpListener.Start(); | |
var buffer = new byte[1024]; | |
while (true) | |
{ | |
var incomingConnection = tcpListener.AcceptTcpClient(); | |
var tcpClient = new TcpClient(); | |
tcpClient.Connect(IPAddress.Loopback, 9999); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
Sync(); | |
Async().Wait(); | |
} | |
const int len = 1024 * 16; |