Definition at line 9 of file Custom.cs.
◆ Custom()
Definition at line 19 of file Custom.cs.
20 {
21 Console.WriteLine("Hello from HSB");
22 c.SetTLSVersion(TLSVersion.TLS_1_2);
23 c.RunAsync(false, 700);
24
25
26 endPoint = new(address, 443);
27
28
29 listener = new(
30 address.AddressFamily,
31 SocketType.Stream,
32 ProtocolType.Tcp
33 );
34
35 listener.Bind(endPoint);
36 listener.Listen(100);
37 }
◆ Run()
Definition at line 39 of file Custom.cs.
40 {
41 while (true)
42 {
43 Socket newSocket = listener.Accept();
44 int received = newSocket.Receive(buffer);
45 if (received > 0 && buffer[0] == 0x16)
46 {
47 new CustomTLS(newSocket).Parse(buffer);
48 }
49 else
50 {
51
52 string reply = "HTTP/1.1 405 Method Not Allowed\r\n" +
53 "Content-Type: text/html\r\n" +
54 "Content-Length: 0\r\n" +
55 "Connection: close\r\n" +
56 "\r\n";
57
58 newSocket.Send(Encoding.UTF8.GetBytes(reply));
59 newSocket.Close();
60 }
61
62 Thread.Sleep(125);
63 }
64
65 }
The documentation for this class was generated from the following file: