class Runcobo::Server

Defined in:

runcobo/server.cr

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new #

[View source]

Class Method Detail

def self.default_handlers : Array(HTTP::Handler) #

Set Default handlers, you can change them by #handlers= after initialize.


[View source]

Instance Method Detail

def cert : String? #

SSL Certificate file.


[View source]
def cert=(cert : String?) #

SSL Certificate file.


[View source]
def client : HTTP::Client #

Creates a client for server.


[View source]
def close : Nil #

Closes server.


[View source]
def generate_tls_context(certificate_chain : String, private_key : String) : OpenSSL::SSL::Context::Server #

Generate TLS context with certificate_chain and private_key


[View source]
def handlers : Array(HTTP::Handler) #

Handlers, defaults to .default_handlers.


[View source]
def handlers=(handlers : Array(HTTP::Handler)) #

Handlers, defaults to .default_handlers.


[View source]
def host : String #

Host, defaults to "0.0.0.0".


[View source]
def host=(host : String) #

Host, defaults to "0.0.0.0".


[View source]
def instance : HTTP::Server #

Server instance.


[View source]
def key : String? #

SSL key file.


[View source]
def key=(key : String?) #

SSL key file.


[View source]
def listen #

Creates a TCPServer listening on #host:#port.


[View source]
def port : Int32 #

Port, defaults to 3000.


[View source]
def port=(port : Int32) #

Port, defaults to 3000.


[View source]
def reuse_port : Bool #

Reuse Port, defaults to false.


[View source]
def reuse_port=(reuse_port : Bool) #

Reuse Port, defaults to false.


[View source]