C# 클래스 HttpServer.WebServer

HTTP server with regular expression path matching, client and server SSL certificates, and a simplified request callback
파일 보기 프로젝트 열기: 3di/3di-viewer-rei-libs 1 사용 예제들

공개 메소드들

메소드 설명
AddHandler ( HttpRequestHandler handler ) : void

Add a request handler

AddHandler ( string method, string contentType, string path, HttpRequestCallback callback ) : void

Add a request handler

RemoveHandler ( HttpRequestHandler handler ) : void

Remove a request handler

Set404Handler ( HttpRequestCallback callback ) : void

Set a callback to override the default 404 (Not Found) response

Start ( ) : void

Start the server

Stop ( ) : void

Stop the server

WebServer ( IPAddress address, int port ) : System

Initialize the server in HTTP mode

WebServer ( IPAddress address, int port, X509Certificate certificate, X509Certificate rootCA, bool requireClientCerts ) : System

Initialize the server in HTTPS (TLS 1.0) mode

비공개 메소드들

메소드 설명
FireRequestCallback ( IHttpClientContext client, IHttpRequest request, IHttpResponse response, HttpRequestCallback callback ) : void
RequestHandler ( IHttpClientContext client, IHttpRequest request ) : void

메소드 상세

AddHandler() 공개 메소드

Add a request handler
public AddHandler ( HttpRequestHandler handler ) : void
handler HttpRequestHandler Request handler to add
리턴 void

AddHandler() 공개 메소드

Add a request handler
public AddHandler ( string method, string contentType, string path, HttpRequestCallback callback ) : void
method string HTTP verb to match, or null to skip verb matching
contentType string Content-Type header to match, or null to skip Content-Type matching
path string Request URI path regular expression to match, or null to skip URI path matching
callback HttpRequestCallback Callback to fire when an incoming request matches the given pattern
리턴 void

RemoveHandler() 공개 메소드

Remove a request handler
public RemoveHandler ( HttpRequestHandler handler ) : void
handler HttpRequestHandler Request handler to remove
리턴 void

Set404Handler() 공개 메소드

Set a callback to override the default 404 (Not Found) response
public Set404Handler ( HttpRequestCallback callback ) : void
callback HttpRequestCallback Callback that will be fired when an unhandled /// request is received, or null to reset to the default handler
리턴 void

Start() 공개 메소드

Start the server
public Start ( ) : void
리턴 void

Stop() 공개 메소드

Stop the server
public Stop ( ) : void
리턴 void

WebServer() 공개 메소드

Initialize the server in HTTP mode
public WebServer ( IPAddress address, int port ) : System
address System.Net.IPAddress IP address to bind to
port int Port number to bind to
리턴 System

WebServer() 공개 메소드

Initialize the server in HTTPS (TLS 1.0) mode
public WebServer ( IPAddress address, int port, X509Certificate certificate, X509Certificate rootCA, bool requireClientCerts ) : System
address System.Net.IPAddress IP address to bind to
port int Port number to bind to
certificate System.Security.Cryptography.X509Certificates.X509Certificate X.509 server certificate for SSL
rootCA System.Security.Cryptography.X509Certificates.X509Certificate X.509 certificate for the root certificate authority /// that signed the server certificate and/or any client certificates
requireClientCerts bool True if client SSL certificates are /// required, otherwise false
리턴 System