Skip to content

Instantly share code, notes, and snippets.

@didge
didge / StaticTcpProxy.cs
Last active June 17, 2022 02:33
Static C# TCP Proxy
using System;
using System.Net;
using System.Net.Sockets;
using System.Threading;
using System.Threading.Tasks;
namespace didge {
public class StaticTcpProxy {
// Use this method to proxy from the proxy's port to the target server's end point. Stop the proxy using returned the CancellationTokenSource.
public static CancellationTokenSource Start(IPEndPoint proxyServerEndPoint, IPEndPoint serverEndPoint) {
@mumoshu
mumoshu / Unity+WebSocket.cs
Created August 31, 2011 16:13
Unity+WebSocket.cs
using UnityEngine;
using System.Collections;
using SuperWebSocket.Client;
using System;
public class Net : MonoBehaviour {
private string lastMessage = string.Empty;
public static string serverURI = "ws://192.168.100.196:12345/channels/0?userId=1";
public static WebSocket webSocket = new WebSocket(serverURI, "basic");