This allows to setup app name for the app
Sets the maximum allowed size for a request body, if the size exceeds the configured limit, it sends
413 - Request Entity Too Large response.
/foo are different routes. When disabled,
/foo are treated the same.
You can define custom color scheme. They'll be used for startup message, route list and some middlewares.
Adds a suffix to the original file name and tries saving the resulting compressed file under the new file name.
Maximum number of concurrent connections.
When set to true, causes the default Content-Type header to be excluded from the Response.
When set to true causes the default date header to be excluded from the response.
By default all header names are normalized: conteNT-tYPE -> Content-Type
Disable keep-alive connections, the server will close incoming connections after sending the first response to the client
Will not pre parse Multipart Form data if set to true. This option is useful for servers that desire to treat multipart form data as a binary blob, or choose when to parse the data.
When set to true, it will not print out debug information
Enable or disable ETag header generation, since both weak and strong etags are generated using the same hashing method (CRC-32). Weak ETags are the default when enabled.
If set to true,
c.IPs() will validate IP addresses before returning them. Also,
c.IP() will return only the first valid IP rather than just the raw header value that may be a comma seperated string.
WARNING: There is a small performance cost to doing this validation. Keep disabled if speed is your only concern and your application is behind a trusted proxy that already validates this header.
EnablePrintRoutes enables print all routes with their method, path, name and handler..
When set to true, fiber will check whether proxy is trusted, using TrustedProxies list.
c.Protocol() will get value from X-Forwarded-Proto, X-Forwarded-Protocol, X-Forwarded-Ssl or X-Url-Scheme header,
c.IP() will get value from
c.Hostname() will get value from X-Forwarded-Host header.
EnableTrustedProxyCheck is true, and
RemoteIP is in the list of
c.Hostname() will have the same behaviour when
EnableTrustedProxyCheck disabled, if
RemoteIP isn't in the list,
c.Protocol() will return https in case when tls connection is handled by the app, or http otherwise,
c.IP() will return RemoteIP() from fasthttp context,
c.Hostname() will return
ErrorHandler is executed when an error is returned from fiber.Handler. Mounted fiber error handlers are retained by the top-level app and applied on prefix associated requests.
Rejects all non-GET requests if set to true. This option is useful as anti-DoS protection for servers accepting only GET requests. The request size is limited by ReadBufferSize if GETOnly is set.
The maximum amount of time to wait for the next request when keep-alive is enabled. If IdleTimeout is zero, the value of ReadTimeout is used.
When enabled, all values returned by context methods are immutable. By default, they are valid until you return from the handler; see issue #185.
Allowing for flexibility in using another json library for decoding.
Allowing for flexibility in using another json library for encoding.
Known networks are "tcp", "tcp4" (IPv4-only), "tcp6" (IPv6-only)
WARNING: When prefork is set to true, only "tcp4" and "tcp6" can be chosen.
PassLocalsToViews Enables passing of the locals set on a fiber.Ctx to the template engine. See our Template Middleware for supported engines.
Enables use of the
SO_REUSEPORTsocket option. This will spawn multiple Go processes listening on the same port. learn more about socket sharding. NOTE: if enabled, the application will need to be ran through a shell because prefork mode sets environment variables. If you're using Docker, make sure the app is ran with
CMD ./app or
CMD ["sh", "-c", "/app"]. For more info, see this issue comment.
This will enable
c.IP() to return the value of the given header key. By default
c.IP()will return the Remote IP from the TCP connection, this property can be useful if you are behind a load balancer e.g. X-Forwarded-*.
per-connection buffer size for requests' reading. This also limits the maximum header size. Increase this buffer if your clients send multi-KB RequestURIs and/or multi-KB headers (for example, BIG cookies).
The amount of time allowed to read the full request, including the body. The default timeout is unlimited.
RequestMethods provides customizibility for HTTP methods. You can add/remove methods as you wish.
Server HTTP header with the given value.
StreamRequestBody enables request body streaming, and calls the handler sooner when given body is larger then the current limit.
When enabled, the router treats
/foo/ as different. Otherwise, the router treats
/foo/ as the same.
Contains the list op trusted proxy IP's. Look at
It can take IP or IP range addresses. If it gets IP range, it iterates all possible addresses.
Converts all encoded characters in the route back before setting the path for the context, so that the routing can also work with URL encoded special characters
Views is the interface that wraps the Render function. See our Template Middleware for supported engines.
Views Layout is the global layout for all template render until override on Render function. See our Template Middleware for supported engines.
Per-connection buffer size for responses' writing.
The maximum duration before timing out writes of the response. The default timeout is unlimited.
Allowing for flexibility in using another XML library for encoding.