Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add https server document #144

Merged
merged 1 commit into from
Feb 2, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions developer/api-plugin-helper-http_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,31 @@ 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, tls_opts: 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, tls_opts: 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.
- `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

Expand Down