Exemplo n.º 1
0
    static void ProcessRequest(TcpClient socket)
    {
        HttpServer.Listen(socket, (request) => {
            if (request.RequestUri.Equals(new Utf8String("/plaintext")))
            {
                var formatter = new BufferFormatter(1024, FormattingData.InvariantUtf8);
                HttpWriter.WriteCommonHeaders(formatter, "HTTP/1.1 200 OK");

                formatter.Append("Hello, World!");

                socket.Write(formatter);
            }
        });
    }