Skip to content

Instantly share code, notes, and snippets.

@wildbook
wildbook / WebSocketServer.cs
Created November 24, 2018 21:37
Very simple websocket server in C#
using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Sockets;
using System.Threading;
public class WebSocketServer
{
public readonly List<WebSocketSession> Clients = new List<WebSocketSession>();
@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) {