From 18f29590695588e225cc5d3f3e82aad3adf2a632 Mon Sep 17 00:00:00 2001 From: Yuta Iwama Date: Mon, 27 Jan 2020 17:43:27 +0900 Subject: [PATCH] Add https server document Signed-off-by: Yuta Iwama --- developer/api-plugin-helper-http_server.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/developer/api-plugin-helper-http_server.md b/developer/api-plugin-helper-http_server.md index 67572404..793c2b96 100644 --- a/developer/api-plugin-helper-http_server.md +++ b/developer/api-plugin-helper-http_server.md @@ -38,6 +38,22 @@ in plugin's `stop` method. The plugin stops launched http server automatically. ### create\_http\_server(title, addr:, port:, logger:, default\_app: nil, &block) +__this method is deprecated. Use http\_server\_create\_http\_server method instead__ + +### http\_server\_create\_http\_server(title, addr:, port:, logger:, default\_app: nil, proto: nil, &block) + +This method creats and runs http server with given routes which are defined in `&block`. + +- `title`: the name of listen thread. this name must be unique +- `addr`: Adderess to listen to +- `port`: Port to listen to. +- `logger`: Logger which is used in server helper +- `default_app`: Use this object when server received a request whose path is not registered. This object must have `#call` or be a `Proc` object. +- `proto`: protocol type. `:tcp`, `:tls`. default value is tcp +- `tls_opts`: options for TLS. same as the [Server Helper's server_create_connection tls_options](/developer/api-plugin-helper-server) + +### http\_server\_create\_https\_server(title, addr:, port:, logger:, default\_app: nil, &block) + This method creats and runs http server with given routes which are defined in `&block`. - `title`: the name of listen thread. this name must be unique @@ -45,6 +61,9 @@ This method creats and runs http server with given routes which are defined in ` - `port`: Port to listen to - `logger`: Logger which is used in server helper - `default_app`: Use this object when server received a request whose path is not registered. This object must have `#call` or be a `Proc` object. +- `proto`: protocol type. `:tcp`, `:tls` +- `tls_opts`: options for TLS. same as the [Server Helper's server_create_connection tls_options](/developer/api-plugin-helper-server) + ## Define other HTTP methods