Flamenco.Writer.writeMethod
write(status_code::Int16, headers::Dict{String, String}; body::String="") :: String

Return HTTP response string

  • Status line
  • Headers
  • Empty line
  • Body (optional)
Flamenco.start_serverFunction
start_server(
    f::Function,
    host::Union{Sockets.IPAddr, String}=Sockets.localhost,
    port::Int64=8000
) :: Server.Request

Start Flamenco server on specified host/port f is function that parsed request is forwarded to

Flamenco.write_responseMethod
write_response(status_code::Int16, headers::Dict{String, String}; body::String) :: String

Return HTTP response String

Flamenco.Server.Utils.has_headerMethod
has_header(headers::Dict{String, String}, key::String, value::String) :: Bool

Check whether corresponding (key, value) pair exists in Header

Flamenco.Server.Writer.writeMethod
write(status_code::Int16, headers::Dict{String, String}; body::String="") :: String

Return HTTP response string

  • Status line
  • Headers
  • Empty line
  • Body (optional)
Flamenco.Server.ParserHttp1_1._parse_headersMethod
_parse_headers(stream::BufferedStreams.BufferedInputStream) :: Dict{String, String}

Return Header as Dict As counter-measure againt Slowloris attack, if parsing takes longer than 4 seconds => return 408 status

Flamenco.Server.ParserHttp1_1.parse_requestMethod
parse_request(stream::BufferedStreams.BufferedInputStream) :: Tuple {String, String, Dict{String, String}, String}

Parse HTTP request (Target, Method, Headers, Body) Only parse Header once, as counter-measure againt Slowloris attack

Flamenco.Server._handle_connectionMethod
_handle_connection(buffered_stream::BufferedStreams.BufferedInputStream) :: Tuple{Error, Request}

Forward BufferedInputStream to Http1.1 parser If error occurs, return Error struct and empty Request struct

Flamenco.Server.startMethod
start(f::Function, host::Union{Sockets.IPAddr, String}, port::Integer) :: Request

Listen to incoming requests on separate threads Write response (execute corresponding Julia function) to Socket, before closing it