Nine Nines https://ninenines.eu/ Recent content on Nine Nines Hugo -- gohugo.io en-us Thu, 18 Jul 2019 07:00:00 +0100 Introduction https://ninenines.eu/docs/en/gun/1.0/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/guide/introduction/ Gun is an HTTP client for Erlang/OTP. Gun supports the HTTP/2, HTTP/1.1 and Websocket protocols. Prerequisites Knowledge of Erlang, but also of the HTTP/1.1, HTTP/2 and Websocket protocols is required in order to read this guide. Supported platforms Gun is tested and supported on Linux, FreeBSD, Windows and OSX. Gun is developed for Erlang/OTP 19.0 and newer. License Gun uses the ISC License. Copyright (c) 2013-2018, Loïc Hoguin <essen@ninenines.eu> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Introduction https://ninenines.eu/docs/en/gun/1.1/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/guide/introduction/ Gun is an HTTP client for Erlang/OTP. Gun supports the HTTP/2, HTTP/1.1 and Websocket protocols. Prerequisites Knowledge of Erlang, but also of the HTTP/1.1, HTTP/2 and Websocket protocols is required in order to read this guide. Supported platforms Gun is tested and supported on Linux, FreeBSD, Windows and OSX. Gun is developed for Erlang/OTP 19.0 and newer. License Gun uses the ISC License. Copyright (c) 2013-2018, Loïc Hoguin <essen@ninenines.eu> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Introduction https://ninenines.eu/docs/en/gun/1.2/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/introduction/ Gun is an HTTP client for Erlang/OTP. Gun supports the HTTP/2, HTTP/1.1 and Websocket protocols. Prerequisites Knowledge of Erlang, but also of the HTTP/1.1, HTTP/2 and Websocket protocols is required in order to read this guide. Supported platforms Gun is tested and supported on Linux, FreeBSD, Windows and OSX. Gun is developed for Erlang/OTP 19.0 and newer. License Gun uses the ISC License. Copyright (c) 2013-2018, Loïc Hoguin <essen@ninenines.eu> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Introduction https://ninenines.eu/docs/en/gun/1.3/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/introduction/ Gun is an HTTP client for Erlang/OTP. Gun supports the HTTP/2, HTTP/1.1 and Websocket protocols. Prerequisites Knowledge of Erlang, but also of the HTTP/1.1, HTTP/2 and Websocket protocols is required in order to read this guide. Supported platforms Gun is tested and supported on Linux, FreeBSD, Windows and OSX. Gun is developed for Erlang/OTP 19.0 and newer. License Gun uses the ISC License. Copyright (c) 2013-2018, Loïc Hoguin <essen@ninenines.eu> Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. Introduction https://ninenines.eu/docs/en/ranch/1.4/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/introduction/ Ranch is a socket acceptor pool for TCP protocols. Ranch aims to provide everything you need to accept TCP connections with a small code base and low latency while being easy to use directly as an application or to embed into your own. Prerequisites It is assumed the developer already knows Erlang and has some experience with socket programming and TCP protocols. Supported platforms Ranch is tested and supported on Linux, FreeBSD, OSX and Windows. Introduction https://ninenines.eu/docs/en/ranch/1.5/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/introduction/ Ranch is a socket acceptor pool for TCP protocols. Ranch aims to provide everything you need to accept TCP connections with a small code base and low latency while being easy to use directly as an application or to embed into your own. Prerequisites It is assumed the developer already knows Erlang and has some experience with socket programming and TCP protocols. Supported platforms Ranch is tested and supported on Linux, FreeBSD, OSX and Windows. Introduction https://ninenines.eu/docs/en/ranch/1.6/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/introduction/ Ranch is a socket acceptor pool for TCP protocols. Ranch aims to provide everything you need to accept TCP connections with a small code base and low latency while being easy to use directly as an application or to embed into your own. Prerequisites It is assumed the developer already knows Erlang and has some experience with socket programming and TCP protocols. Supported platforms Ranch is tested and supported on Linux, FreeBSD, OSX and Windows. Introduction https://ninenines.eu/docs/en/ranch/1.7/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/introduction/ Ranch is a socket acceptor pool for TCP protocols. Ranch aims to provide everything you need to accept TCP connections with a small code base and low latency while being easy to use directly as an application or to embed into your own. Prerequisites It is assumed the developer already knows Erlang and has some experience with socket programming and TCP protocols. Supported platforms Ranch is tested and supported on Linux, FreeBSD, OSX and Windows. Introduction https://ninenines.eu/docs/en/ranch/2.0/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/introduction/ Ranch is a socket acceptor pool for TCP protocols. Ranch aims to provide everything you need to accept TCP connections with a small code base and low latency while being easy to use directly as an application or to embed into your own. Prerequisites It is assumed the developer already knows Erlang and has some experience with socket programming and TCP protocols. Supported platforms Ranch is tested and supported on Linux, FreeBSD, macOS and Windows. The modern Web https://ninenines.eu/docs/en/cowboy/2.2/guide/modern_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/modern_web/ Cowboy is a server for the modern Web. This chapter explains what it means and details all the standards involved. Cowboy supports all the standards listed in this document. HTTP/2 HTTP/2 is the most efficient protocol for consuming Web services. It enables clients to keep a connection open for long periods of time; to send requests concurrently; to reduce the size of requests through HTTP headers compression; and more. The protocol is binary, greatly reducing the resources needed to parse it. The modern Web https://ninenines.eu/docs/en/cowboy/2.3/guide/modern_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/modern_web/ Cowboy is a server for the modern Web. This chapter explains what it means and details all the standards involved. Cowboy supports all the standards listed in this document. HTTP/2 HTTP/2 is the most efficient protocol for consuming Web services. It enables clients to keep a connection open for long periods of time; to send requests concurrently; to reduce the size of requests through HTTP headers compression; and more. The protocol is binary, greatly reducing the resources needed to parse it. The modern Web https://ninenines.eu/docs/en/cowboy/2.4/guide/modern_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/modern_web/ Cowboy is a server for the modern Web. This chapter explains what it means and details all the standards involved. Cowboy supports all the standards listed in this document. HTTP/2 HTTP/2 is the most efficient protocol for consuming Web services. It enables clients to keep a connection open for long periods of time; to send requests concurrently; to reduce the size of requests through HTTP headers compression; and more. The protocol is binary, greatly reducing the resources needed to parse it. The modern Web https://ninenines.eu/docs/en/cowboy/2.5/guide/modern_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/modern_web/ Cowboy is a server for the modern Web. This chapter explains what it means and details all the standards involved. Cowboy supports all the standards listed in this document. HTTP/2 HTTP/2 is the most efficient protocol for consuming Web services. It enables clients to keep a connection open for long periods of time; to send requests concurrently; to reduce the size of requests through HTTP headers compression; and more. The protocol is binary, greatly reducing the resources needed to parse it. The modern Web https://ninenines.eu/docs/en/cowboy/2.6/guide/modern_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/modern_web/ Cowboy is a server for the modern Web. This chapter explains what it means and details all the standards involved. Cowboy supports all the standards listed in this document. HTTP/2 HTTP/2 is the most efficient protocol for consuming Web services. It enables clients to keep a connection open for long periods of time; to send requests concurrently; to reduce the size of requests through HTTP headers compression; and more. The protocol is binary, greatly reducing the resources needed to parse it. Erlang and the Web https://ninenines.eu/docs/en/cowboy/2.2/guide/erlang_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/erlang_web/ Erlang is the ideal platform for writing Web applications. Its features are a perfect match for the requirements of modern Web applications. The Web is concurrent When you access a website there is little concurrency involved. A few connections are opened and requests are sent through these connections. Then the web page is displayed on your screen. Your browser will only open up to 4 or 8 connections to the server, depending on your settings. Erlang and the Web https://ninenines.eu/docs/en/cowboy/2.3/guide/erlang_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/erlang_web/ Erlang is the ideal platform for writing Web applications. Its features are a perfect match for the requirements of modern Web applications. The Web is concurrent When you access a website there is little concurrency involved. A few connections are opened and requests are sent through these connections. Then the web page is displayed on your screen. Your browser will only open up to 4 or 8 connections to the server, depending on your settings. Erlang and the Web https://ninenines.eu/docs/en/cowboy/2.4/guide/erlang_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/erlang_web/ Erlang is the ideal platform for writing Web applications. Its features are a perfect match for the requirements of modern Web applications. The Web is concurrent When you access a website there is little concurrency involved. A few connections are opened and requests are sent through these connections. Then the web page is displayed on your screen. Your browser will only open up to 4 or 8 connections to the server, depending on your settings. Erlang and the Web https://ninenines.eu/docs/en/cowboy/2.5/guide/erlang_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/erlang_web/ Erlang is the ideal platform for writing Web applications. Its features are a perfect match for the requirements of modern Web applications. The Web is concurrent When you access a website there is little concurrency involved. A few connections are opened and requests are sent through these connections. Then the web page is displayed on your screen. Your browser will only open up to 4 or 8 connections to the server, depending on your settings. Erlang and the Web https://ninenines.eu/docs/en/cowboy/2.6/guide/erlang_web/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/erlang_web/ Erlang is the ideal platform for writing Web applications. Its features are a perfect match for the requirements of modern Web applications. The Web is concurrent When you access a website there is little concurrency involved. A few connections are opened and requests are sent through these connections. Then the web page is displayed on your screen. Your browser will only open up to 4 or 8 connections to the server, depending on your settings. Listeners https://ninenines.eu/docs/en/ranch/1.4/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/listeners/ A listener is a set of processes whose role is to listen on a port for new connections. It manages a pool of acceptor processes, each of them indefinitely accepting connections. When it does, it starts a new process executing the protocol handler code. All the socket programming is abstracted through the use of transport handlers. The listener takes care of supervising all the acceptor and connection processes, allowing developers to focus on building their application. Listeners https://ninenines.eu/docs/en/ranch/1.5/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/listeners/ A listener is a set of processes whose role is to listen on a port for new connections. It manages a pool of acceptor processes, each of them indefinitely accepting connections. When it does, it starts a new process executing the protocol handler code. All the socket programming is abstracted through the use of transport handlers. The listener takes care of supervising all the acceptor and connection processes, allowing developers to focus on building their application. Listeners https://ninenines.eu/docs/en/ranch/1.6/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/listeners/ A listener is a set of processes whose role is to listen on a port for new connections. It manages a pool of acceptor processes, each of them indefinitely accepting connections. When it does, it starts a new process executing the protocol handler code. All the socket programming is abstracted through the use of transport handlers. The listener takes care of supervising all the acceptor and connection processes, allowing developers to focus on building their application. Listeners https://ninenines.eu/docs/en/ranch/1.7/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/listeners/ A listener is a set of processes whose role is to listen on a port for new connections. It manages a pool of acceptor processes, each of them indefinitely accepting connections. When it does, it starts a new process executing the protocol handler code. All the socket programming is abstracted through the use of transport handlers. The listener takes care of supervising all the acceptor and connection processes, allowing developers to focus on building their application. Listeners https://ninenines.eu/docs/en/ranch/2.0/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/listeners/ A listener is a set of processes whose role is to listen on a port for new connections. It manages a pool of acceptor processes, each of them indefinitely accepting connections. When it does, it starts a new process executing the protocol handler code. All the socket programming is abstracted through the use of transport handlers. The listener takes care of supervising all the acceptor and connection processes, allowing developers to focus on building their application. Starting and stopping https://ninenines.eu/docs/en/gun/1.0/guide/start/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/guide/start/ This chapter describes how to start and stop the Gun application. Setting up Specify Gun as a dependency to your application in your favorite build tool. With Erlang.mk this is done by adding gun to the DEPS variable in your Makefile. Adding Gun as an Erlang.mk dependency DEPS = gun Starting Gun is an OTP application. It needs to be started before you can use it. Starting Gun in an Erlang shell 1> application:ensure_all_started(gun). Starting and stopping https://ninenines.eu/docs/en/gun/1.1/guide/start/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/guide/start/ This chapter describes how to start and stop the Gun application. Setting up Specify Gun as a dependency to your application in your favorite build tool. With Erlang.mk this is done by adding gun to the DEPS variable in your Makefile. Adding Gun as an Erlang.mk dependency DEPS = gun Starting Gun is an OTP application. It needs to be started before you can use it. Starting Gun in an Erlang shell 1> application:ensure_all_started(gun). Starting and stopping https://ninenines.eu/docs/en/gun/1.2/guide/start/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/start/ This chapter describes how to start and stop the Gun application. Setting up Specify Gun as a dependency to your application in your favorite build tool. With Erlang.mk this is done by adding gun to the DEPS variable in your Makefile. Adding Gun as an Erlang.mk dependency DEPS = gun Starting Gun is an OTP application. It needs to be started before you can use it. Starting Gun in an Erlang shell 1> application:ensure_all_started(gun). Starting and stopping https://ninenines.eu/docs/en/gun/1.3/guide/start/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/start/ This chapter describes how to start and stop the Gun application. Setting up Specify Gun as a dependency to your application in your favorite build tool. With Erlang.mk this is done by adding gun to the DEPS variable in your Makefile. Adding Gun as an Erlang.mk dependency DEPS = gun Starting Gun is an OTP application. It needs to be started before you can use it. Starting Gun in an Erlang shell 1> application:ensure_all_started(gun). Supported protocols https://ninenines.eu/docs/en/gun/1.0/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/guide/protocols/ This chapter describes the protocols supported and the operations available to them. HTTP/1.1 HTTP/1.1 is a text request-response protocol. The client sends a request, the server sends back a response. Gun provides convenience functions for performing GET, HEAD, OPTIONS, POST, PATCH, PUT, and DELETE requests. All these functions are aliases of gun:request/4,5,6 for the respective methods. Gun also provides a gun:data/4 function for streaming the request body. Gun will send a gun_inform message for every intermediate informational responses received. Supported protocols https://ninenines.eu/docs/en/gun/1.1/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/guide/protocols/ This chapter describes the protocols supported and the operations available to them. HTTP/1.1 HTTP/1.1 is a text request-response protocol. The client sends a request, the server sends back a response. Gun provides convenience functions for performing GET, HEAD, OPTIONS, POST, PATCH, PUT, and DELETE requests. All these functions are aliases of gun:request/4,5,6 for the respective methods. Gun also provides a gun:data/4 function for streaming the request body. Gun will send a gun_inform message for every intermediate informational responses received. Supported protocols https://ninenines.eu/docs/en/gun/1.2/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/protocols/ This chapter describes the protocols supported and the operations available to them. HTTP/1.1 HTTP/1.1 is a text request-response protocol. The client sends a request, the server sends back a response. Gun provides convenience functions for performing GET, HEAD, OPTIONS, POST, PATCH, PUT, and DELETE requests. All these functions are aliases of gun:request/4,5,6 for the respective methods. Gun also provides a gun:data/4 function for streaming the request body. Gun will send a gun_inform message for every intermediate informational responses received. Supported protocols https://ninenines.eu/docs/en/gun/1.3/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/protocols/ This chapter describes the protocols supported and the operations available to them. HTTP/1.1 HTTP/1.1 is a text request-response protocol. The client sends a request, the server sends back a response. Gun provides convenience functions for performing GET, HEAD, OPTIONS, POST, PATCH, PUT, and DELETE requests. All these functions are aliases of gun:request/4,5,6 for the respective methods. Gun also provides a gun:data/4 function for streaming the request body. Gun will send a gun_inform message for every intermediate informational responses received. Introduction https://ninenines.eu/docs/en/cowboy/2.2/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/introduction/ Cowboy is a small, fast and modern HTTP server for Erlang/OTP. Cowboy aims to provide a complete modern Web stack. This includes HTTP/1.1, HTTP/2, Websocket, Server-Sent Events and Webmachine-based REST. Cowboy comes with functions for introspection and tracing, enabling developers to know precisely what is happening at any time. Its modular design also easily enable developers to add instrumentation. Cowboy is a high quality project. It has a small code base, is very efficient (both in latency and memory use) and can easily be embedded in another application. Introduction https://ninenines.eu/docs/en/cowboy/2.3/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/introduction/ Cowboy is a small, fast and modern HTTP server for Erlang/OTP. Cowboy aims to provide a complete modern Web stack. This includes HTTP/1.1, HTTP/2, Websocket, Server-Sent Events and Webmachine-based REST. Cowboy comes with functions for introspection and tracing, enabling developers to know precisely what is happening at any time. Its modular design also easily enable developers to add instrumentation. Cowboy is a high quality project. It has a small code base, is very efficient (both in latency and memory use) and can easily be embedded in another application. Introduction https://ninenines.eu/docs/en/cowboy/2.4/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/introduction/ Cowboy is a small, fast and modern HTTP server for Erlang/OTP. Cowboy aims to provide a complete modern Web stack. This includes HTTP/1.1, HTTP/2, Websocket, Server-Sent Events and Webmachine-based REST. Cowboy comes with functions for introspection and tracing, enabling developers to know precisely what is happening at any time. Its modular design also easily enable developers to add instrumentation. Cowboy is a high quality project. It has a small code base, is very efficient (both in latency and memory use) and can easily be embedded in another application. Introduction https://ninenines.eu/docs/en/cowboy/2.5/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/introduction/ Cowboy is a small, fast and modern HTTP server for Erlang/OTP. Cowboy aims to provide a complete modern Web stack. This includes HTTP/1.1, HTTP/2, Websocket, Server-Sent Events and Webmachine-based REST. Cowboy comes with functions for introspection and tracing, enabling developers to know precisely what is happening at any time. Its modular design also easily enable developers to add instrumentation. Cowboy is a high quality project. It has a small code base, is very efficient (both in latency and memory use) and can easily be embedded in another application. Introduction https://ninenines.eu/docs/en/cowboy/2.6/guide/introduction/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/introduction/ Cowboy is a small, fast and modern HTTP server for Erlang/OTP. Cowboy aims to provide a complete modern Web stack. This includes HTTP/1.1, HTTP/2, Websocket, Server-Sent Events and Webmachine-based REST. Cowboy comes with functions for introspection and tracing, enabling developers to know precisely what is happening at any time. Its modular design also easily enable developers to add instrumentation. Cowboy is a high quality project. It has a small code base, is very efficient (both in latency and memory use) and can easily be embedded in another application. Transports https://ninenines.eu/docs/en/ranch/1.4/guide/transports/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/transports/ A transport defines the interface to interact with a socket. Transports can be used for connecting, listening and accepting connections, but also for receiving and sending data. Both passive and active mode are supported, although all sockets are initialized as passive. TCP transport The TCP transport is a thin wrapper around gen_tcp. SSL transport The SSL transport is a thin wrapper around ssl. Ranch depends on ssl by default so any necessary dependencies will start when Ranch is started. Transports https://ninenines.eu/docs/en/ranch/1.5/guide/transports/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/transports/ A transport defines the interface to interact with a socket. Transports can be used for connecting, listening and accepting connections, but also for receiving and sending data. Both passive and active mode are supported, although all sockets are initialized as passive. TCP transport The TCP transport is a thin wrapper around gen_tcp. SSL transport The SSL transport is a thin wrapper around ssl. Ranch depends on ssl by default so any necessary dependencies will start when Ranch is started. Transports https://ninenines.eu/docs/en/ranch/1.6/guide/transports/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/transports/ A transport defines the interface to interact with a socket. Transports can be used for connecting, listening and accepting connections, but also for receiving and sending data. Both passive and active mode are supported, although all sockets are initialized as passive. TCP transport The TCP transport is a thin wrapper around gen_tcp. SSL transport The SSL transport is a thin wrapper around ssl. Ranch depends on ssl by default so any necessary dependencies will start when Ranch is started. Transports https://ninenines.eu/docs/en/ranch/1.7/guide/transports/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/transports/ A transport defines the interface to interact with a socket. Transports can be used for connecting, listening and accepting connections, but also for receiving and sending data. Both passive and active mode are supported, although all sockets are initialized as passive. TCP transport The TCP transport is a thin wrapper around gen_tcp. SSL transport The SSL transport is a thin wrapper around ssl. Ranch depends on ssl by default so any necessary dependencies will start when Ranch is started. Transports https://ninenines.eu/docs/en/ranch/2.0/guide/transports/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/transports/ A transport defines the interface to interact with a socket. Transports can be used for connecting, listening and accepting connections, but also for receiving and sending data. Both passive and active mode are supported, although all sockets are initialized as passive. TCP transport The TCP transport is a thin wrapper around gen_tcp. SSL transport The SSL transport is a thin wrapper around ssl. Ranch depends on ssl by default so any necessary dependencies will start when Ranch is started. Connection https://ninenines.eu/docs/en/gun/1.0/guide/connect/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/guide/connect/ This chapter describes how to open, monitor and close a connection using the Gun client. Gun connections Gun is designed with the HTTP/2 and Websocket protocols in mind. They are built for long-running connections that allow concurrent exchange of data, either in the form of request/responses for HTTP/2 or in the form of messages for Websocket. A Gun connection is an Erlang process that manages a socket to a remote endpoint. Connection https://ninenines.eu/docs/en/gun/1.1/guide/connect/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/guide/connect/ This chapter describes how to open, monitor and close a connection using the Gun client. Gun connections Gun is designed with the HTTP/2 and Websocket protocols in mind. They are built for long-running connections that allow concurrent exchange of data, either in the form of request/responses for HTTP/2 or in the form of messages for Websocket. A Gun connection is an Erlang process that manages a socket to a remote endpoint. Connection https://ninenines.eu/docs/en/gun/1.2/guide/connect/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/connect/ This chapter describes how to open, monitor and close a connection using the Gun client. Gun connections Gun is designed with the HTTP/2 and Websocket protocols in mind. They are built for long-running connections that allow concurrent exchange of data, either in the form of request/responses for HTTP/2 or in the form of messages for Websocket. A Gun connection is an Erlang process that manages a socket to a remote endpoint. Connection https://ninenines.eu/docs/en/gun/1.3/guide/connect/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/connect/ This chapter describes how to open, monitor and close a connection using the Gun client. Gun connections Gun is designed with the HTTP/2 and Websocket protocols in mind. They are built for long-running connections that allow concurrent exchange of data, either in the form of request/responses for HTTP/2 or in the form of messages for Websocket. A Gun connection is an Erlang process that manages a socket to a remote endpoint. Protocols https://ninenines.eu/docs/en/ranch/1.4/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/protocols/ A protocol handler starts a connection process and defines the protocol logic executed in this process. Writing a protocol handler All protocol handlers must implement the ranch_protocol behavior which defines a single callback, start_link/4. This callback is responsible for spawning a new process for handling the connection. It receives four arguments: the name of the listener, the socket, the transport handler being used and the protocol options defined in the call to ranch:start_listener/5. Protocols https://ninenines.eu/docs/en/ranch/1.5/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/protocols/ A protocol handler starts a connection process and defines the protocol logic executed in this process. Writing a protocol handler All protocol handlers must implement the ranch_protocol behavior which defines a single callback, start_link/4. This callback is responsible for spawning a new process for handling the connection. It receives four arguments: the name of the listener, the socket, the transport handler being used and the protocol options defined in the call to ranch:start_listener/5. Protocols https://ninenines.eu/docs/en/ranch/1.6/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/protocols/ A protocol handler starts a connection process and defines the protocol logic executed in this process. Writing a protocol handler All protocol handlers must implement the ranch_protocol behavior which defines a single callback, start_link/4. This callback is responsible for spawning a new process for handling the connection. It receives four arguments: the name of the listener, the socket, the transport handler being used and the protocol options defined in the call to ranch:start_listener/5. Protocols https://ninenines.eu/docs/en/ranch/1.7/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/protocols/ A protocol handler starts a connection process and defines the protocol logic executed in this process. Writing a protocol handler All protocol handlers must implement the ranch_protocol behavior which defines a single callback, start_link/4. This callback is responsible for spawning a new process for handling the connection. It receives four arguments: the name of the listener, the socket, the transport handler being used and the protocol options defined in the call to ranch:start_listener/5. Protocols https://ninenines.eu/docs/en/ranch/2.0/guide/protocols/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/protocols/ A protocol handler starts a connection process and defines the protocol logic executed in this process. Writing a protocol handler All protocol handlers must implement the ranch_protocol behavior which defines a single callback, start_link/4. This callback is responsible for spawning a new process for handling the connection. It receives four arguments: the name of the listener, the socket, the transport handler being used and the protocol options defined in the call to ranch:start_listener/5. Getting started https://ninenines.eu/docs/en/cowboy/2.2/guide/getting_started/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/getting_started/ Erlang is more than a language, it is also an operating system for your applications. Erlang developers rarely write standalone modules, they write libraries or applications, and then bundle those into what is called a release. A release contains the Erlang VM plus all applications required to run the node, so it can be pushed to production directly. This chapter walks you through all the steps of setting up Cowboy, writing your first application and generating your first release. Getting started https://ninenines.eu/docs/en/cowboy/2.3/guide/getting_started/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/getting_started/ Erlang is more than a language, it is also an operating system for your applications. Erlang developers rarely write standalone modules, they write libraries or applications, and then bundle those into what is called a release. A release contains the Erlang VM plus all applications required to run the node, so it can be pushed to production directly. This chapter walks you through all the steps of setting up Cowboy, writing your first application and generating your first release. Getting started https://ninenines.eu/docs/en/cowboy/2.4/guide/getting_started/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/getting_started/ Erlang is more than a language, it is also an operating system for your applications. Erlang developers rarely write standalone modules, they write libraries or applications, and then bundle those into what is called a release. A release contains the Erlang VM plus all applications required to run the node, so it can be pushed to production directly. This chapter walks you through all the steps of setting up Cowboy, writing your first application and generating your first release. Getting started https://ninenines.eu/docs/en/cowboy/2.5/guide/getting_started/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/getting_started/ Erlang is more than a language, it is also an operating system for your applications. Erlang developers rarely write standalone modules, they write libraries or applications, and then bundle those into what is called a release. A release contains the Erlang VM plus all applications required to run the node, so it can be pushed to production directly. This chapter walks you through all the steps of setting up Cowboy, writing your first application and generating your first release. Getting started https://ninenines.eu/docs/en/cowboy/2.6/guide/getting_started/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/getting_started/ Erlang is more than a language, it is also an operating system for your applications. Erlang developers rarely write standalone modules, they write libraries or applications, and then bundle those into what is called a release. A release contains the Erlang VM plus all applications required to run the node, so it can be pushed to production directly. This chapter walks you through all the steps of setting up Cowboy, writing your first application and generating your first release. HTTP https://ninenines.eu/docs/en/gun/1.0/guide/http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/guide/http/ This chapter describes how to use the Gun client for communicating with an HTTP/1.1 or HTTP/2 server. Streams Every time a request is initiated, Gun creates a stream. A stream reference uniquely identifies a set of request and response and must be used to perform additional operations with a stream or to identify its messages. Stream references use the Erlang reference data type and are therefore unique. Streams can be canceled at any time. HTTP https://ninenines.eu/docs/en/gun/1.1/guide/http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/guide/http/ This chapter describes how to use the Gun client for communicating with an HTTP/1.1 or HTTP/2 server. Streams Every time a request is initiated, Gun creates a stream. A stream reference uniquely identifies a set of request and response and must be used to perform additional operations with a stream or to identify its messages. Stream references use the Erlang reference data type and are therefore unique. Streams can be canceled at any time. HTTP https://ninenines.eu/docs/en/gun/1.2/guide/http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/http/ This chapter describes how to use the Gun client for communicating with an HTTP/1.1 or HTTP/2 server. Streams Every time a request is initiated, Gun creates a stream. A stream reference uniquely identifies a set of request and response and must be used to perform additional operations with a stream or to identify its messages. Stream references use the Erlang reference data type and are therefore unique. Streams can be canceled at any time. HTTP https://ninenines.eu/docs/en/gun/1.3/guide/http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/http/ This chapter describes how to use the Gun client for communicating with an HTTP/1.1 or HTTP/2 server. Streams Every time a request is initiated, Gun creates a stream. A stream reference uniquely identifies a set of request and response and must be used to perform additional operations with a stream or to identify its messages. Stream references use the Erlang reference data type and are therefore unique. Streams can be canceled at any time. Embedded mode https://ninenines.eu/docs/en/ranch/1.4/guide/embedded/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/embedded/ Embedded mode allows you to insert Ranch listeners directly in your supervision tree. This allows for greater fault tolerance control by permitting the shutdown of a listener due to the failure of another part of the application and vice versa. Embedding To embed Ranch in your application you can simply add the child specs to your supervision tree. This can all be done in the init/1 function of one of your application supervisors. Embedded mode https://ninenines.eu/docs/en/ranch/1.5/guide/embedded/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/embedded/ Embedded mode allows you to insert Ranch listeners directly in your supervision tree. This allows for greater fault tolerance control by permitting the shutdown of a listener due to the failure of another part of the application and vice versa. Embedding To embed Ranch in your application you can simply add the child specs to your supervision tree. This can all be done in the init/1 function of one of your application supervisors. Embedded mode https://ninenines.eu/docs/en/ranch/1.6/guide/embedded/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/embedded/ Embedded mode allows you to insert Ranch listeners directly in your supervision tree. This allows for greater fault tolerance control by permitting the shutdown of a listener due to the failure of another part of the application and vice versa. Embedding To embed Ranch in your application you can simply add the child specs to your supervision tree. This can all be done in the init/1 function of one of your application supervisors. Embedded mode https://ninenines.eu/docs/en/ranch/1.7/guide/embedded/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/embedded/ Embedded mode allows you to insert Ranch listeners directly in your supervision tree. This allows for greater fault tolerance control by permitting the shutdown of a listener due to the failure of another part of the application and vice versa. Embedding To embed Ranch in your application you can simply add the child specs to your supervision tree. This can all be done in the init/1 function of one of your application supervisors. Embedded mode https://ninenines.eu/docs/en/ranch/2.0/guide/embedded/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/embedded/ Embedded mode allows you to insert Ranch listeners directly in your supervision tree. This allows for greater fault tolerance control by permitting the shutdown of a listener due to the failure of another part of the application and vice versa. However, just as for non-embedded listeners that were started via ranch:start_listener/5, it is required that the ranch application is running before you can start embedded listeners. Furthermore, this also means that embedded listeners will restart when ranch_sup fails. Flow diagram https://ninenines.eu/docs/en/cowboy/2.2/guide/flow_diagram/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/flow_diagram/ Cowboy is a lightweight HTTP server with support for HTTP/1.1, HTTP/2 and Websocket. It is built on top of Ranch. Please see the Ranch guide for more information about how the network connections are handled. Overview As you can see on the diagram, the client begins by connecting to the server. This step is handled by a Ranch acceptor, which is a process dedicated to accepting new connections. After Ranch accepts a new connection, whether it is an HTTP/1. Flow diagram https://ninenines.eu/docs/en/cowboy/2.3/guide/flow_diagram/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/flow_diagram/ Cowboy is a lightweight HTTP server with support for HTTP/1.1, HTTP/2 and Websocket. It is built on top of Ranch. Please see the Ranch guide for more information about how the network connections are handled. Overview As you can see on the diagram, the client begins by connecting to the server. This step is handled by a Ranch acceptor, which is a process dedicated to accepting new connections. After Ranch accepts a new connection, whether it is an HTTP/1. Flow diagram https://ninenines.eu/docs/en/cowboy/2.4/guide/flow_diagram/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/flow_diagram/ Cowboy is a lightweight HTTP server with support for HTTP/1.1, HTTP/2 and Websocket. It is built on top of Ranch. Please see the Ranch guide for more information about how the network connections are handled. Overview As you can see on the diagram, the client begins by connecting to the server. This step is handled by a Ranch acceptor, which is a process dedicated to accepting new connections. After Ranch accepts a new connection, whether it is an HTTP/1. Flow diagram https://ninenines.eu/docs/en/cowboy/2.5/guide/flow_diagram/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/flow_diagram/ Cowboy is a lightweight HTTP server with support for HTTP/1.1, HTTP/2 and Websocket. It is built on top of Ranch. Please see the Ranch guide for more information about how the network connections are handled. Overview As you can see on the diagram, the client begins by connecting to the server. This step is handled by a Ranch acceptor, which is a process dedicated to accepting new connections. After Ranch accepts a new connection, whether it is an HTTP/1. Flow diagram https://ninenines.eu/docs/en/cowboy/2.6/guide/flow_diagram/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/flow_diagram/ Cowboy is a lightweight HTTP server with support for HTTP/1.1, HTTP/2 and Websocket. It is built on top of Ranch. Please see the Ranch guide for more information about how the network connections are handled. Overview As you can see on the diagram, the client begins by connecting to the server. This step is handled by a Ranch acceptor, which is a process dedicated to accepting new connections. After Ranch accepts a new connection, whether it is an HTTP/1. Websocket https://ninenines.eu/docs/en/gun/1.0/guide/websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/guide/websocket/ This chapter describes how to use the Gun client for communicating with a Websocket server. HTTP upgrade Websocket is a protocol built on top of HTTP. To use Websocket, you must first request for the connection to be upgraded. Only HTTP/1.1 connections can be upgraded to Websocket, so you might need to restrict the protocol to HTTP/1.1 if you are planning to use Websocket over TLS. You must use the gun:ws_upgrade/2,3,4 function to upgrade to Websocket. Websocket https://ninenines.eu/docs/en/gun/1.1/guide/websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/guide/websocket/ This chapter describes how to use the Gun client for communicating with a Websocket server. HTTP upgrade Websocket is a protocol built on top of HTTP. To use Websocket, you must first request for the connection to be upgraded. Only HTTP/1.1 connections can be upgraded to Websocket, so you might need to restrict the protocol to HTTP/1.1 if you are planning to use Websocket over TLS. You must use the gun:ws_upgrade/2,3,4 function to upgrade to Websocket. Websocket https://ninenines.eu/docs/en/gun/1.2/guide/websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/websocket/ This chapter describes how to use the Gun client for communicating with a Websocket server. HTTP upgrade Websocket is a protocol built on top of HTTP. To use Websocket, you must first request for the connection to be upgraded. Only HTTP/1.1 connections can be upgraded to Websocket, so you might need to restrict the protocol to HTTP/1.1 if you are planning to use Websocket over TLS. You must use the gun:ws_upgrade/2,3,4 function to upgrade to Websocket. Websocket https://ninenines.eu/docs/en/gun/1.3/guide/websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/websocket/ This chapter describes how to use the Gun client for communicating with a Websocket server. HTTP upgrade Websocket is a protocol built on top of HTTP. To use Websocket, you must first request for the connection to be upgraded. Only HTTP/1.1 connections can be upgraded to Websocket, so you might need to restrict the protocol to HTTP/1.1 if you are planning to use Websocket over TLS. You must use the gun:ws_upgrade/2,3,4 function to upgrade to Websocket. Writing parsers https://ninenines.eu/docs/en/ranch/1.4/guide/parsers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/parsers/ There are three kinds of protocols: Text protocols Schema-less binary protocols Schema-based binary protocols This chapter introduces the first two kinds. It will not cover more advanced topics such as continuations or parser generators. This chapter isn't specifically about Ranch, we assume here that you know how to read data from the socket. The data you read and the data that hasn't been parsed is saved in a buffer. Writing parsers https://ninenines.eu/docs/en/ranch/1.5/guide/parsers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/parsers/ There are three kinds of protocols: Text protocols Schema-less binary protocols Schema-based binary protocols This chapter introduces the first two kinds. It will not cover more advanced topics such as continuations or parser generators. This chapter isn't specifically about Ranch, we assume here that you know how to read data from the socket. The data you read and the data that hasn't been parsed is saved in a buffer. Writing parsers https://ninenines.eu/docs/en/ranch/1.6/guide/parsers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/parsers/ There are three kinds of protocols: Text protocols Schema-less binary protocols Schema-based binary protocols This chapter introduces the first two kinds. It will not cover more advanced topics such as continuations or parser generators. This chapter isn't specifically about Ranch, we assume here that you know how to read data from the socket. The data you read and the data that hasn't been parsed is saved in a buffer. Writing parsers https://ninenines.eu/docs/en/ranch/1.7/guide/parsers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/parsers/ There are three kinds of protocols: Text protocols Schema-less binary protocols Schema-based binary protocols This chapter introduces the first two kinds. It will not cover more advanced topics such as continuations or parser generators. This chapter isn't specifically about Ranch, we assume here that you know how to read data from the socket. The data you read and the data that hasn't been parsed is saved in a buffer. Writing parsers https://ninenines.eu/docs/en/ranch/2.0/guide/parsers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/parsers/ There are three kinds of protocols: Text protocols Schema-less binary protocols Schema-based binary protocols This chapter introduces the first two kinds. It will not cover more advanced topics such as continuations or parser generators. This chapter isn't specifically about Ranch, we assume here that you know how to read data from the socket. The data you read and the data that hasn't been parsed is saved in a buffer. Migrating from Gun 1.0 to 1.1 https://ninenines.eu/docs/en/gun/1.1/guide/migrating_from_1.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/guide/migrating_from_1.0/ Gun 1.1 updates the Cowlib dependency to 2.5.1 and fixes a few problems with experimental features. Features added Update Cowlib to 2.5.1 Bugs fixed A bug in the experimental gun_sse_h where lone id lines were not propagated has been fixed by updating the Cowlib dependency. The status code was incorrectly given to the experimental content handlers as a binary. It has been fixed an an integer is now given as was intended. Migrating from Gun 1.1 to 1.2 https://ninenines.eu/docs/en/gun/1.2/guide/migrating_from_1.1/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/migrating_from_1.1/ Gun 1.2 adds support for the CONNECT request over HTTP/1.1 connections. Features added CONNECT requests can now be issued on HTTP/1.1 connections. The tunneled connection can use any of the protocols Gun supports: HTTP/1.1, HTTP/2 and Websocket over both TCP and TLS transports. Note that Gun currently does not support tunneling a TLS connection over a TLS connection due to limitations in Erlang/OTP. Gun supports sending multiple CONNECT requests, allowing the tunnel to the origin server to go through multiple proxies. Migrating from Gun 1.2 to 1.3 https://ninenines.eu/docs/en/gun/1.3/guide/migrating_from_1.2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/migrating_from_1.2/ Gun 1.3 improves the support for CONNECT requests introduced in the previous version and documents Websocket protocol negotiation. Features added The protocols CONNECT destination option has been added as a replacement for the now deprecated protocol option. Add built-in support for Websocket protocol negotiation through the Websocket option protocols. The interface of the handler module currently remains undocumented and must be set to gun_ws_h. Add the h2specd HTTP/2 test suite from the h2spec project. Listeners https://ninenines.eu/docs/en/cowboy/2.2/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/listeners/ A listener is a set of processes that listens on a port for new connections. Incoming connections get handled by Cowboy. Depending on the connection handshake, one or another protocol may be used. This chapter is specific to Cowboy. Please refer to the Ranch User Guide for more information about listeners. Cowboy provides two types of listeners: one listening for clear TCP connections, and one listening for secure TLS connections. Both of them support the HTTP/1. Listeners https://ninenines.eu/docs/en/cowboy/2.3/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/listeners/ A listener is a set of processes that listens on a port for new connections. Incoming connections get handled by Cowboy. Depending on the connection handshake, one or another protocol may be used. This chapter is specific to Cowboy. Please refer to the Ranch User Guide for more information about listeners. Cowboy provides two types of listeners: one listening for clear TCP connections, and one listening for secure TLS connections. Both of them support the HTTP/1. Listeners https://ninenines.eu/docs/en/cowboy/2.4/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/listeners/ A listener is a set of processes that listens on a port for new connections. Incoming connections get handled by Cowboy. Depending on the connection handshake, one or another protocol may be used. This chapter is specific to Cowboy. Please refer to the Ranch User Guide for more information about listeners. Cowboy provides two types of listeners: one listening for clear TCP connections, and one listening for secure TLS connections. Both of them support the HTTP/1. Listeners https://ninenines.eu/docs/en/cowboy/2.5/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/listeners/ A listener is a set of processes that listens on a port for new connections. Incoming connections get handled by Cowboy. Depending on the connection handshake, one or another protocol may be used. This chapter is specific to Cowboy. Please refer to the Ranch User Guide for more information about listeners. Cowboy provides two types of listeners: one listening for clear TCP connections, and one listening for secure TLS connections. Both of them support the HTTP/1. Listeners https://ninenines.eu/docs/en/cowboy/2.6/guide/listeners/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/listeners/ A listener is a set of processes that listens on a port for new connections. Incoming connections get handled by Cowboy. Depending on the connection handshake, one or another protocol may be used. This chapter is specific to Cowboy. Please refer to the Ranch User Guide for more information about listeners. Cowboy provides two types of listeners: one listening for clear TCP connections, and one listening for secure TLS connections. Both of them support the HTTP/1. SSL client authentication https://ninenines.eu/docs/en/ranch/1.4/guide/ssl_auth/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/ssl_auth/ Purpose SSL client authentication is a mechanism allowing applications to identify certificates. This allows your application to make sure that the client is an authorized certificate, but makes no claim about whether the user can be trusted. This can be combined with a password based authentication to attain greater security. The server only needs to retain the certificate serial number and the certificate issuer to authenticate the certificate. Together, they can be used to uniquely identify a certicate. SSL client authentication https://ninenines.eu/docs/en/ranch/1.5/guide/ssl_auth/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/ssl_auth/ Purpose SSL client authentication is a mechanism allowing applications to identify certificates. This allows your application to make sure that the client is an authorized certificate, but makes no claim about whether the user can be trusted. This can be combined with a password based authentication to attain greater security. The server only needs to retain the certificate serial number and the certificate issuer to authenticate the certificate. Together, they can be used to uniquely identify a certicate. SSL client authentication https://ninenines.eu/docs/en/ranch/1.6/guide/ssl_auth/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/ssl_auth/ Purpose SSL client authentication is a mechanism allowing applications to identify certificates. This allows your application to make sure that the client is an authorized certificate, but makes no claim about whether the user can be trusted. This can be combined with a password based authentication to attain greater security. The server only needs to retain the certificate serial number and the certificate issuer to authenticate the certificate. Together, they can be used to uniquely identify a certicate. SSL client authentication https://ninenines.eu/docs/en/ranch/1.7/guide/ssl_auth/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/ssl_auth/ Purpose SSL client authentication is a mechanism allowing applications to identify certificates. This allows your application to make sure that the client is an authorized certificate, but makes no claim about whether the user can be trusted. This can be combined with a password based authentication to attain greater security. The server only needs to retain the certificate serial number and the certificate issuer to authenticate the certificate. Together, they can be used to uniquely identify a certicate. SSL client authentication https://ninenines.eu/docs/en/ranch/2.0/guide/ssl_auth/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/ssl_auth/ Purpose SSL client authentication is a mechanism allowing applications to identify certificates. This allows your application to make sure that the client is an authorized certificate, but makes no claim about whether the user can be trusted. This can be combined with a password based authentication to attain greater security. The server only needs to retain the certificate serial number and the certificate issuer to authenticate the certificate. Together, they can be used to uniquely identify a certicate. Routing https://ninenines.eu/docs/en/cowboy/2.2/guide/routing/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/routing/ Cowboy does nothing by default. To make Cowboy useful, you need to map URIs to Erlang modules that will handle the requests. This is called routing. When Cowboy receives a request, it tries to match the requested host and path to the configured routes. When there's a match, the route's associated handler is executed. Routes need to be compiled before they can be used by Cowboy. The result of the compilation is the dispatch rules. Routing https://ninenines.eu/docs/en/cowboy/2.3/guide/routing/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/routing/ Cowboy does nothing by default. To make Cowboy useful, you need to map URIs to Erlang modules that will handle the requests. This is called routing. When Cowboy receives a request, it tries to match the requested host and path to the configured routes. When there's a match, the route's associated handler is executed. Routes need to be compiled before they can be used by Cowboy. The result of the compilation is the dispatch rules. Routing https://ninenines.eu/docs/en/cowboy/2.4/guide/routing/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/routing/ Cowboy does nothing by default. To make Cowboy useful, you need to map URIs to Erlang modules that will handle the requests. This is called routing. When Cowboy receives a request, it tries to match the requested host and path to the configured routes. When there's a match, the route's associated handler is executed. Routes need to be compiled before they can be used by Cowboy. The result of the compilation is the dispatch rules. Routing https://ninenines.eu/docs/en/cowboy/2.5/guide/routing/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/routing/ Cowboy does nothing by default. To make Cowboy useful, you need to map URIs to Erlang modules that will handle the requests. This is called routing. When Cowboy receives a request, it tries to match the requested host and path to the configured routes. When there's a match, the route's associated handler is executed. Routes need to be compiled before they can be used by Cowboy. The result of the compilation is the dispatch rules. Routing https://ninenines.eu/docs/en/cowboy/2.6/guide/routing/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/routing/ Cowboy does nothing by default. To make Cowboy useful, you need to map URIs to Erlang modules that will handle the requests. This is called routing. When Cowboy receives a request, it tries to match the requested host and path to the configured routes. When there's a match, the route's associated handler is executed. Routes need to be compiled before they can be used by Cowboy. The result of the compilation is the dispatch rules. Connection draining https://ninenines.eu/docs/en/ranch/2.0/guide/connection_draining/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/connection_draining/ Stopping a Ranch listener via ranch:stop_listener/1 will invariably kill all connection processes the listener hosts. However, you may want to stop a listener in a graceful fashion, ie by not accepting any new connections, but allowing the existing connection processes to exit by themselves instead of being killed. For this purpose, you should first suspend the listener you wish to stop gracefully, and then wait for its connection count to drop to zero. Internals https://ninenines.eu/docs/en/ranch/1.4/guide/internals/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/internals/ This chapter may not apply to embedded Ranch as embedding allows you to use an architecture specific to your application, which may or may not be compatible with the description of the Ranch application. Note that for everything related to efficiency and performance, you should perform the benchmarks yourself to get the numbers that matter to you. Generic benchmarks found on the web may or may not be of use to you, you can never know until you benchmark your own system. Internals https://ninenines.eu/docs/en/ranch/1.5/guide/internals/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/internals/ This chapter may not apply to embedded Ranch as embedding allows you to use an architecture specific to your application, which may or may not be compatible with the description of the Ranch application. Note that for everything related to efficiency and performance, you should perform the benchmarks yourself to get the numbers that matter to you. Generic benchmarks found on the web may or may not be of use to you, you can never know until you benchmark your own system. Internals https://ninenines.eu/docs/en/ranch/1.6/guide/internals/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/internals/ This chapter may not apply to embedded Ranch as embedding allows you to use an architecture specific to your application, which may or may not be compatible with the description of the Ranch application. Note that for everything related to efficiency and performance, you should perform the benchmarks yourself to get the numbers that matter to you. Generic benchmarks found on the web may or may not be of use to you, you can never know until you benchmark your own system. Internals https://ninenines.eu/docs/en/ranch/1.7/guide/internals/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/internals/ This chapter may not apply to embedded Ranch as embedding allows you to use an architecture specific to your application, which may or may not be compatible with the description of the Ranch application. Note that for everything related to efficiency and performance, you should perform the benchmarks yourself to get the numbers that matter to you. Generic benchmarks found on the web may or may not be of use to you, you can never know until you benchmark your own system. Migrating from Gun 1.0 to 1.1 https://ninenines.eu/docs/en/gun/1.2/guide/migrating_from_1.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/migrating_from_1.0/ Gun 1.1 updates the Cowlib dependency to 2.5.1 and fixes a few problems with experimental features. Features added Update Cowlib to 2.5.1 Bugs fixed A bug in the experimental gun_sse_h where lone id lines were not propagated has been fixed by updating the Cowlib dependency. The status code was incorrectly given to the experimental content handlers as a binary. It has been fixed an an integer is now given as was intended. Migrating from Gun 1.1 to 1.2 https://ninenines.eu/docs/en/gun/1.3/guide/migrating_from_1.1/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/migrating_from_1.1/ Gun 1.2 adds support for the CONNECT request over HTTP/1.1 connections. Features added CONNECT requests can now be issued on HTTP/1.1 connections. The tunneled connection can use any of the protocols Gun supports: HTTP/1.1, HTTP/2 and Websocket over both TCP and TLS transports. Note that Gun currently does not support tunneling a TLS connection over a TLS connection due to limitations in Erlang/OTP. Gun supports sending multiple CONNECT requests, allowing the tunnel to the origin server to go through multiple proxies. Constraints https://ninenines.eu/docs/en/cowboy/2.2/guide/constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/constraints/ Constraints are validation and conversion functions applied to user input. They are used in various places in Cowboy, including the router and the cowboy_req match functions. Syntax Constraints are provided as a list of fields. For each field in the list, specific constraints can be applied, as well as a default value if the field is missing. A field can take the form of an atom field, a tuple with constraints {field, Constraints} or a tuple with constraints and a default value {field, Constraints, Default}. Constraints https://ninenines.eu/docs/en/cowboy/2.3/guide/constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/constraints/ Constraints are validation and conversion functions applied to user input. They are used in various places in Cowboy, including the router and the cowboy_req match functions. Syntax Constraints are provided as a list of fields. For each field in the list, specific constraints can be applied, as well as a default value if the field is missing. A field can take the form of an atom field, a tuple with constraints {field, Constraints} or a tuple with constraints and a default value {field, Constraints, Default}. Constraints https://ninenines.eu/docs/en/cowboy/2.4/guide/constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/constraints/ Constraints are validation and conversion functions applied to user input. They are used in various places in Cowboy, including the router and the cowboy_req match functions. Syntax Constraints are provided as a list of fields. For each field in the list, specific constraints can be applied, as well as a default value if the field is missing. A field can take the form of an atom field, a tuple with constraints {field, Constraints} or a tuple with constraints and a default value {field, Constraints, Default}. Constraints https://ninenines.eu/docs/en/cowboy/2.5/guide/constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/constraints/ Constraints are validation and conversion functions applied to user input. They are used in various places in Cowboy, including the router and the cowboy_req match functions. Syntax Constraints are provided as a list of fields. For each field in the list, specific constraints can be applied, as well as a default value if the field is missing. A field can take the form of an atom field, a tuple with constraints {field, Constraints} or a tuple with constraints and a default value {field, Constraints, Default}. Constraints https://ninenines.eu/docs/en/cowboy/2.6/guide/constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/constraints/ Constraints are validation and conversion functions applied to user input. They are used in various places in Cowboy, including the router and the cowboy_req match functions. Syntax Constraints are provided as a list of fields. For each field in the list, specific constraints can be applied, as well as a default value if the field is missing. A field can take the form of an atom field, a tuple with constraints {field, Constraints} or a tuple with constraints and a default value {field, Constraints, Default}. Upcoming changes in Ranch 2.0 https://ninenines.eu/docs/en/ranch/1.6/guide/upcoming_2.0_changes/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/upcoming_2.0_changes/ The following changes will be done in Ranch 2.0. In most cases an alternative is already available in the most recent Ranch version. The function ranch:start_listener/6 has been deprecated in favor of ranch:start_listener/5. The number of acceptors was removed and will be taken from the transport options. The function ranch:child_spec/6 has also been deprecated, in favor of ranch:child_spec/5. The function ranch:accept_ack/1 has been deprecated in favor of ranch:handshake/1,2. The function ranch:info/1,2 will return a map containing each listener's information rather than a list of key/values. Upcoming changes in Ranch 2.0 https://ninenines.eu/docs/en/ranch/1.7/guide/upcoming_2.0_changes/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/upcoming_2.0_changes/ The following changes will be done in Ranch 2.0. In most cases an alternative is already available in the most recent Ranch version. The function ranch:start_listener/6 has been deprecated in favor of ranch:start_listener/5. The number of acceptors was removed and will be taken from the transport options. The function ranch:child_spec/6 has also been deprecated, in favor of ranch:child_spec/5. The function ranch:accept_ack/1 has been deprecated in favor of ranch:handshake/1,2. The function ranch:info/1,2 will return a map containing each listener's information rather than a list of key/values. Internals https://ninenines.eu/docs/en/ranch/2.0/guide/internals/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/internals/ This chapter may not apply to embedded Ranch as embedding allows you to use an architecture specific to your application, which may or may not be compatible with the description of the Ranch application. Note that for everything related to efficiency and performance, you should perform the benchmarks yourself to get the numbers that matter to you. Generic benchmarks found on the web may or may not be of use to you, you can never know until you benchmark your own system. Migrating from Gun 1.0 to 1.1 https://ninenines.eu/docs/en/gun/1.3/guide/migrating_from_1.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/migrating_from_1.0/ Gun 1.1 updates the Cowlib dependency to 2.5.1 and fixes a few problems with experimental features. Features added Update Cowlib to 2.5.1 Bugs fixed A bug in the experimental gun_sse_h where lone id lines were not propagated has been fixed by updating the Cowlib dependency. The status code was incorrectly given to the experimental content handlers as a binary. It has been fixed an an integer is now given as was intended. Handlers https://ninenines.eu/docs/en/cowboy/2.2/guide/handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/handlers/ Handlers are Erlang modules that handle HTTP requests. Plain HTTP handlers The most basic handler in Cowboy implements the mandatory init/2 callback, manipulates the request, optionally sends a response and then returns. This callback receives the Req object and the initial state defined in the router configuration. A handler that does nothing would look like this: init(Req, State) -> {ok, Req, State}. Despite sending no reply, a 204 No Content response will be sent to the client, as Cowboy makes sure that a response is sent for every request. Handlers https://ninenines.eu/docs/en/cowboy/2.3/guide/handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/handlers/ Handlers are Erlang modules that handle HTTP requests. Plain HTTP handlers The most basic handler in Cowboy implements the mandatory init/2 callback, manipulates the request, optionally sends a response and then returns. This callback receives the Req object and the initial state defined in the router configuration. A handler that does nothing would look like this: init(Req, State) -> {ok, Req, State}. Despite sending no reply, a 204 No Content response will be sent to the client, as Cowboy makes sure that a response is sent for every request. Handlers https://ninenines.eu/docs/en/cowboy/2.4/guide/handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/handlers/ Handlers are Erlang modules that handle HTTP requests. Plain HTTP handlers The most basic handler in Cowboy implements the mandatory init/2 callback, manipulates the request, optionally sends a response and then returns. This callback receives the Req object and the initial state defined in the router configuration. A handler that does nothing would look like this: init(Req, State) -> {ok, Req, State}. Despite sending no reply, a 204 No Content response will be sent to the client, as Cowboy makes sure that a response is sent for every request. Handlers https://ninenines.eu/docs/en/cowboy/2.5/guide/handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/handlers/ Handlers are Erlang modules that handle HTTP requests. Plain HTTP handlers The most basic handler in Cowboy implements the mandatory init/2 callback, manipulates the request, optionally sends a response and then returns. This callback receives the Req object and the initial state defined in the router configuration. A handler that does nothing would look like this: init(Req, State) -> {ok, Req, State}. Despite sending no reply, a 204 No Content response will be sent to the client, as Cowboy makes sure that a response is sent for every request. Handlers https://ninenines.eu/docs/en/cowboy/2.6/guide/handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/handlers/ Handlers are Erlang modules that handle HTTP requests. Plain HTTP handlers The most basic handler in Cowboy implements the mandatory init/2 callback, manipulates the request, optionally sends a response and then returns. This callback receives the Req object and the initial state defined in the router configuration. A handler that does nothing would look like this: init(Req, State) -> {ok, Req, State}. Despite sending no reply, a 204 No Content response will be sent to the client, as Cowboy makes sure that a response is sent for every request. Migrating from Ranch 1.7 to Ranch 2.0 https://ninenines.eu/docs/en/ranch/2.0/guide/migrating_from_1.7/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/migrating_from_1.7/ Ranch 2.0 adds support for multiple connection supervisors. Ranch 1.x had a bottleneck because it used only a single connection supervisor. This was more evident when many connections were dropped at once as the supervisor couldn't keep up and failed to accept new connections while cleaning up the old ones. Ranch 2.0 behaves much better in this scenario by default. Multiple connection supervisors also helps with concurrently accepting new connections. Changes since Ranch 1.6 https://ninenines.eu/docs/en/ranch/1.6/guide/migrating_from_1.6/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/migrating_from_1.6/ The following patch versions were released since Ranch 1.6: Ranch 1.6.2 This release fixes an issue where listener information would not get cleaned up when an embedded listener was stopped. Ranch 1.6.1 This release fixes a minor issue in the README and adds an undocumented function to help Cowboy deal with the transition from list to map for the transport options. Changes since Ranch 1.7 https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.7/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.7/ The following patch versions were released since Ranch 1.7: Ranch 1.7.1 This release fixes an issue with the PROXY protocol where the wrong CRC32 algorithm was used and would cause checksum verification to fail. Because the plain crc32 checksum is not supported by the PROXY protocol, the configuration value when building PROXY headers has been changed to crc32c. Loop handlers https://ninenines.eu/docs/en/cowboy/2.2/guide/loop_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/loop_handlers/ Loop handlers are a special kind of HTTP handlers used when the response can not be sent right away. The handler enters instead a receive loop waiting for the right message before it can send a response. Loop handlers are used for requests where a response might not be immediately available, but where you would like to keep the connection open for a while in case the response arrives. The most known example of such practice is known as long polling. Loop handlers https://ninenines.eu/docs/en/cowboy/2.3/guide/loop_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/loop_handlers/ Loop handlers are a special kind of HTTP handlers used when the response can not be sent right away. The handler enters instead a receive loop waiting for the right message before it can send a response. Loop handlers are used for requests where a response might not be immediately available, but where you would like to keep the connection open for a while in case the response arrives. The most known example of such practice is known as long polling. Loop handlers https://ninenines.eu/docs/en/cowboy/2.4/guide/loop_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/loop_handlers/ Loop handlers are a special kind of HTTP handlers used when the response can not be sent right away. The handler enters instead a receive loop waiting for the right message before it can send a response. Loop handlers are used for requests where a response might not be immediately available, but where you would like to keep the connection open for a while in case the response arrives. The most known example of such practice is known as long polling. Loop handlers https://ninenines.eu/docs/en/cowboy/2.5/guide/loop_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/loop_handlers/ Loop handlers are a special kind of HTTP handlers used when the response can not be sent right away. The handler enters instead a receive loop waiting for the right message before it can send a response. Loop handlers are used for requests where a response might not be immediately available, but where you would like to keep the connection open for a while in case the response arrives. The most known example of such practice is known as long polling. Loop handlers https://ninenines.eu/docs/en/cowboy/2.6/guide/loop_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/loop_handlers/ Loop handlers are a special kind of HTTP handlers used when the response can not be sent right away. The handler enters instead a receive loop waiting for the right message before it can send a response. Loop handlers are used for requests where a response might not be immediately available, but where you would like to keep the connection open for a while in case the response arrives. The most known example of such practice is known as long polling. Static files https://ninenines.eu/docs/en/cowboy/2.2/guide/static_files/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/static_files/ Cowboy comes with a ready to use handler for serving static files. It is provided as a convenience for serving files during development. For systems in production, consider using one of the many Content Distribution Network (CDN) available on the market, as they are the best solution for serving files. The static handler can serve either one file or all files from a given directory. The etag generation and mime types can be configured. Static files https://ninenines.eu/docs/en/cowboy/2.3/guide/static_files/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/static_files/ Cowboy comes with a ready to use handler for serving static files. It is provided as a convenience for serving files during development. For systems in production, consider using one of the many Content Distribution Network (CDN) available on the market, as they are the best solution for serving files. The static handler can serve either one file or all files from a given directory. The etag generation and mime types can be configured. Static files https://ninenines.eu/docs/en/cowboy/2.4/guide/static_files/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/static_files/ Cowboy comes with a ready to use handler for serving static files. It is provided as a convenience for serving files during development. For systems in production, consider using one of the many Content Distribution Network (CDN) available on the market, as they are the best solution for serving files. The static handler can serve either one file or all files from a given directory. The etag generation and mime types can be configured. Static files https://ninenines.eu/docs/en/cowboy/2.5/guide/static_files/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/static_files/ Cowboy comes with a ready to use handler for serving static files. It is provided as a convenience for serving files during development. For systems in production, consider using one of the many Content Distribution Network (CDN) available on the market, as they are the best solution for serving files. The static handler can serve either one file or all files from a given directory. The etag generation and mime types can be configured. Static files https://ninenines.eu/docs/en/cowboy/2.6/guide/static_files/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/static_files/ Cowboy comes with a ready to use handler for serving static files. It is provided as a convenience for serving files during development. For systems in production, consider using one of the many Content Distribution Network (CDN) available on the market, as they are the best solution for serving files. The static handler can serve either one file or all files from a given directory. The etag generation and mime types can be configured. Migrating from Ranch 1.6 to 1.7 https://ninenines.eu/docs/en/ranch/2.0/guide/migrating_from_1.6/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/migrating_from_1.6/ Ranch 1.7 adds built-in support for the PROXY protocol. The PROXY protocol is a simple and efficient way for proxies to transmit information about the client. While a third-party library already existed, it was not entirely compatible with the Ranch interface, in particular when socket active mode was involved. This new implementation fixes that and supports the full protocol with as little overhead as possible compared to normal operations: just one extra function call. Migrating from Ranch 1.5 to 1.6 https://ninenines.eu/docs/en/ranch/1.6/guide/migrating_from_1.5/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/migrating_from_1.5/ Ranch 1.6 added the ability to suspend and resume listeners. It also deprecates a number of features and add interfaces that will be used in Ranch 2.0. Ranch 1.6 is compatible with Erlang/OTP 18.0 onward. Support for older releases has been removed. Features added Listeners can now be suspended/resumed without stopping existing connection processes. This effectively closes the listening socket and stops the acceptor processes. Transport options can now be updated for suspended listeners. Migrating from Ranch 1.6 to 1.7 https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.6/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.6/ Ranch 1.7 adds built-in support for the PROXY protocol. The PROXY protocol is a simple and efficient way for proxies to transmit information about the client. While a third-party library already existed, it was not entirely compatible with the Ranch interface, in particular when socket active mode was involved. This new implementation fixes that and supports the full protocol with as little overhead as possible compared to normal operations: just one extra function call. The Req object https://ninenines.eu/docs/en/cowboy/2.2/guide/req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/req/ The Req object is a variable used for obtaining information about a request, read its body or send a response. It is not really an object in the object-oriented sense. It is a simple map that can be directly accessed or used when calling functions from the cowboy_req module. The Req object is the subject of a few different chapters. In this chapter we will learn about the Req object and look at how to retrieve information about the request. The Req object https://ninenines.eu/docs/en/cowboy/2.3/guide/req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/req/ The Req object is a variable used for obtaining information about a request, read its body or send a response. It is not really an object in the object-oriented sense. It is a simple map that can be directly accessed or used when calling functions from the cowboy_req module. The Req object is the subject of a few different chapters. In this chapter we will learn about the Req object and look at how to retrieve information about the request. The Req object https://ninenines.eu/docs/en/cowboy/2.4/guide/req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/req/ The Req object is a variable used for obtaining information about a request, read its body or send a response. It is not really an object in the object-oriented sense. It is a simple map that can be directly accessed or used when calling functions from the cowboy_req module. The Req object is the subject of a few different chapters. In this chapter we will learn about the Req object and look at how to retrieve information about the request. The Req object https://ninenines.eu/docs/en/cowboy/2.5/guide/req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/req/ The Req object is a variable used for obtaining information about a request, read its body or send a response. It is not really an object in the object-oriented sense. It is a simple map that can be directly accessed or used when calling functions from the cowboy_req module. The Req object is the subject of a few different chapters. In this chapter we will learn about the Req object and look at how to retrieve information about the request. The Req object https://ninenines.eu/docs/en/cowboy/2.6/guide/req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/req/ The Req object is a variable used for obtaining information about a request, read its body or send a response. It is not really an object in the object-oriented sense. It is a simple map that can be directly accessed or used when calling functions from the cowboy_req module. The Req object is the subject of a few different chapters. In this chapter we will learn about the Req object and look at how to retrieve information about the request. Migrating from Ranch 1.5 to 1.6 https://ninenines.eu/docs/en/ranch/2.0/guide/migrating_from_1.5/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/migrating_from_1.5/ Ranch 1.6 added the ability to suspend and resume listeners. It also deprecates a number of features and add interfaces that will be used in Ranch 2.0. Ranch 1.6 is compatible with Erlang/OTP 18.0 onward. Support for older releases has been removed. Features added Listeners can now be suspended/resumed without stopping existing connection processes. This effectively closes the listening socket and stops the acceptor processes. Transport options can now be updated for suspended listeners. Migrating from Ranch 1.5 to 1.6 https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.5/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.5/ Ranch 1.6 added the ability to suspend and resume listeners. It also deprecates a number of features and add interfaces that will be used in Ranch 2.0. Ranch 1.6 is compatible with Erlang/OTP 18.0 onward. Support for older releases has been removed. Features added Listeners can now be suspended/resumed without stopping existing connection processes. This effectively closes the listening socket and stops the acceptor processes. Transport options can now be updated for suspended listeners. Migrating from Ranch 1.x https://ninenines.eu/docs/en/ranch/1.6/guide/migrating_from_1.x/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/migrating_from_1.x/ The changelog for Ranch releases before 1.6 can be found in this section. 1.5.0 Add transport functions getopts/2, getstat/1 and getstat/2 Fix ranch:info/0 and ranch:procs/2 in embedded mode Prevent ranch_conns_sup from stopping on unexpected messages 1.4.0 Add new transport option num_acceptor Deprecate ranch:start_listener/6 in favor of start_listener/5 Deprecate ranch:child_spec/6 in favor of child_spec/5 1.3.0 The version numbers 1.3.1 and 1.3.2 were later made to fix small mistakes made during the 1. Reading the request body https://ninenines.eu/docs/en/cowboy/2.2/guide/req_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/req_body/ The request body can be read using the Req object. Cowboy will not attempt to read the body until requested. You need to call the body reading functions in order to retrieve it. Cowboy will not cache the body, it is therefore only possible to read it once. You are not required to read it, however. If a body is present and was not read, Cowboy will either cancel or skip its download, depending on the protocol. Reading the request body https://ninenines.eu/docs/en/cowboy/2.3/guide/req_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/req_body/ The request body can be read using the Req object. Cowboy will not attempt to read the body until requested. You need to call the body reading functions in order to retrieve it. Cowboy will not cache the body, it is therefore only possible to read it once. You are not required to read it, however. If a body is present and was not read, Cowboy will either cancel or skip its download, depending on the protocol. Reading the request body https://ninenines.eu/docs/en/cowboy/2.4/guide/req_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/req_body/ The request body can be read using the Req object. Cowboy will not attempt to read the body until requested. You need to call the body reading functions in order to retrieve it. Cowboy will not cache the body, it is therefore only possible to read it once. You are not required to read it, however. If a body is present and was not read, Cowboy will either cancel or skip its download, depending on the protocol. Reading the request body https://ninenines.eu/docs/en/cowboy/2.5/guide/req_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/req_body/ The request body can be read using the Req object. Cowboy will not attempt to read the body until requested. You need to call the body reading functions in order to retrieve it. Cowboy will not cache the body, it is therefore only possible to read it once. You are not required to read it, however. If a body is present and was not read, Cowboy will either cancel or skip its download, depending on the protocol. Reading the request body https://ninenines.eu/docs/en/cowboy/2.6/guide/req_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/req_body/ The request body can be read using the Req object. Cowboy will not attempt to read the body until requested. You need to call the body reading functions in order to retrieve it. Cowboy will not cache the body, it is therefore only possible to read it once. You are not required to read it, however. If a body is present and was not read, Cowboy will either cancel or skip its download, depending on the protocol. Sending a response https://ninenines.eu/docs/en/cowboy/2.2/guide/resp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/resp/ The response must be sent using the Req object. Cowboy provides two different ways of sending responses: either directly or by streaming the body. Response headers and body may be set in advance. The response is sent as soon as one of the reply or stream reply function is called. Cowboy also provides a simplified interface for sending files. It can also send only specific parts of a file. While only one response is allowed for every request, HTTP/2 introduced a mechanism that allows the server to push additional resources related to the response. Sending a response https://ninenines.eu/docs/en/cowboy/2.3/guide/resp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/resp/ The response must be sent using the Req object. Cowboy provides two different ways of sending responses: either directly or by streaming the body. Response headers and body may be set in advance. The response is sent as soon as one of the reply or stream reply function is called. Cowboy also provides a simplified interface for sending files. It can also send only specific parts of a file. While only one response is allowed for every request, HTTP/2 introduced a mechanism that allows the server to push additional resources related to the response. Sending a response https://ninenines.eu/docs/en/cowboy/2.4/guide/resp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/resp/ The response must be sent using the Req object. Cowboy provides two different ways of sending responses: either directly or by streaming the body. Response headers and body may be set in advance. The response is sent as soon as one of the reply or stream reply function is called. Cowboy also provides a simplified interface for sending files. It can also send only specific parts of a file. While only one response is allowed for every request, HTTP/2 introduced a mechanism that allows the server to push additional resources related to the response. Sending a response https://ninenines.eu/docs/en/cowboy/2.5/guide/resp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/resp/ The response must be sent using the Req object. Cowboy provides two different ways of sending responses: either directly or by streaming the body. Response headers and body may be set in advance. The response is sent as soon as one of the reply or stream reply function is called. Cowboy also provides a simplified interface for sending files. It can also send only specific parts of a file. While only one response is allowed for every request, HTTP/2 introduced a mechanism that allows the server to push additional resources related to the response. Sending a response https://ninenines.eu/docs/en/cowboy/2.6/guide/resp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/resp/ The response must be sent using the Req object. Cowboy provides two different ways of sending responses: either directly or by streaming the body. Response headers and body may be set in advance. The response is sent as soon as one of the reply or stream reply function is called. Cowboy also provides a simplified interface for sending files. It can also send only specific parts of a file. While only one response is allowed for every request, HTTP/2 introduced a mechanism that allows the server to push additional resources related to the response. Migrating from Ranch 1.x https://ninenines.eu/docs/en/ranch/2.0/guide/migrating_from_1.x/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/migrating_from_1.x/ The changelog for Ranch releases before 1.6 can be found in this section. 1.5.0 Add transport functions getopts/2, getstat/1 and getstat/2 Fix ranch:info/0 and ranch:procs/2 in embedded mode Prevent ranch_conns_sup from stopping on unexpected messages 1.4.0 Add new transport option num_acceptor Deprecate ranch:start_listener/6 in favor of start_listener/5 Deprecate ranch:child_spec/6 in favor of child_spec/5 1.3.0 The version numbers 1.3.1 and 1.3.2 were later made to fix small mistakes made during the 1. Migrating from Ranch 1.x https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.x/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/migrating_from_1.x/ The changelog for Ranch releases before 1.6 can be found in this section. 1.5.0 Add transport functions getopts/2, getstat/1 and getstat/2 Fix ranch:info/0 and ranch:procs/2 in embedded mode Prevent ranch_conns_sup from stopping on unexpected messages 1.4.0 Add new transport option num_acceptor Deprecate ranch:start_listener/6 in favor of start_listener/5 Deprecate ranch:child_spec/6 in favor of child_spec/5 1.3.0 The version numbers 1.3.1 and 1.3.2 were later made to fix small mistakes made during the 1. Using cookies https://ninenines.eu/docs/en/cowboy/2.2/guide/cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/cookies/ Cookies are a mechanism allowing applications to maintain state on top of the stateless HTTP protocol. Cookies are a name/value store where the names and values are stored in plain text. They expire either after a delay or when the browser closes. They can be configured on a specific domain name or path, and restricted to secure resources (sent or downloaded over HTTPS), or restricted to the server (disallowing access from client-side scripts). Using cookies https://ninenines.eu/docs/en/cowboy/2.3/guide/cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/cookies/ Cookies are a mechanism allowing applications to maintain state on top of the stateless HTTP protocol. Cookies are a name/value store where the names and values are stored in plain text. They expire either after a delay or when the browser closes. They can be configured on a specific domain name or path, and restricted to secure resources (sent or downloaded over HTTPS), or restricted to the server (disallowing access from client-side scripts). Using cookies https://ninenines.eu/docs/en/cowboy/2.4/guide/cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/cookies/ Cookies are a mechanism allowing applications to maintain state on top of the stateless HTTP protocol. Cookies are a name/value store where the names and values are stored in plain text. They expire either after a delay or when the browser closes. They can be configured on a specific domain name or path, and restricted to secure resources (sent or downloaded over HTTPS), or restricted to the server (disallowing access from client-side scripts). Using cookies https://ninenines.eu/docs/en/cowboy/2.5/guide/cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/cookies/ Cookies are a mechanism allowing applications to maintain state on top of the stateless HTTP protocol. Cookies are a name/value store where the names and values are stored in plain text. They expire either after a delay or when the browser closes. They can be configured on a specific domain name or path, and restricted to secure resources (sent or downloaded over HTTPS), or restricted to the server (disallowing access from client-side scripts). Using cookies https://ninenines.eu/docs/en/cowboy/2.6/guide/cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/cookies/ Cookies are a mechanism allowing applications to maintain state on top of the stateless HTTP protocol. Cookies are a name/value store where the names and values are stored in plain text. They expire either after a delay or when the browser closes. They can be configured on a specific domain name or path, and restricted to secure resources (sent or downloaded over HTTPS), or restricted to the server (disallowing access from client-side scripts). Multipart requests https://ninenines.eu/docs/en/cowboy/2.2/guide/multipart/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/multipart/ Multipart originates from MIME, an Internet standard that extends the format of emails. A multipart message is a list of parts. A part contains headers and a body. The body of the parts may be of any media type, and contain text or binary data. It is possible for parts to contain a multipart media type. In the context of HTTP, multipart is most often used with the multipart/form-data media type. Multipart requests https://ninenines.eu/docs/en/cowboy/2.3/guide/multipart/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/multipart/ Multipart originates from MIME, an Internet standard that extends the format of emails. A multipart message is a list of parts. A part contains headers and a body. The body of the parts may be of any media type, and contain text or binary data. It is possible for parts to contain a multipart media type. In the context of HTTP, multipart is most often used with the multipart/form-data media type. Multipart requests https://ninenines.eu/docs/en/cowboy/2.4/guide/multipart/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/multipart/ Multipart originates from MIME, an Internet standard that extends the format of emails. A multipart message is a list of parts. A part contains headers and a body. The body of the parts may be of any media type, and contain text or binary data. It is possible for parts to contain a multipart media type. In the context of HTTP, multipart is most often used with the multipart/form-data media type. Multipart requests https://ninenines.eu/docs/en/cowboy/2.5/guide/multipart/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/multipart/ Multipart originates from MIME, an Internet standard that extends the format of emails. A multipart message is a list of parts. A part contains headers and a body. The body of the parts may be of any media type, and contain text or binary data. It is possible for parts to contain a multipart media type. In the context of HTTP, multipart is most often used with the multipart/form-data media type. Multipart requests https://ninenines.eu/docs/en/cowboy/2.6/guide/multipart/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/multipart/ Multipart originates from MIME, an Internet standard that extends the format of emails. A multipart message is a list of parts. A part contains headers and a body. The body of the parts may be of any media type, and contain text or binary data. It is possible for parts to contain a multipart media type. In the context of HTTP, multipart is most often used with the multipart/form-data media type. REST principles https://ninenines.eu/docs/en/cowboy/2.2/guide/rest_principles/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/rest_principles/ This chapter will attempt to define the concepts behind REST and explain what makes a service RESTful. REST is often confused with performing a distinct operation depending on the HTTP method, while using more than the GET and POST methods. That's highly misguided at best. We will first attempt to define REST and will look at what it means in the context of HTTP and the Web. For a more in-depth explanation of REST, you can read Roy T. REST principles https://ninenines.eu/docs/en/cowboy/2.3/guide/rest_principles/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/rest_principles/ This chapter will attempt to define the concepts behind REST and explain what makes a service RESTful. REST is often confused with performing a distinct operation depending on the HTTP method, while using more than the GET and POST methods. That's highly misguided at best. We will first attempt to define REST and will look at what it means in the context of HTTP and the Web. For a more in-depth explanation of REST, you can read Roy T. REST principles https://ninenines.eu/docs/en/cowboy/2.4/guide/rest_principles/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/rest_principles/ This chapter will attempt to define the concepts behind REST and explain what makes a service RESTful. REST is often confused with performing a distinct operation depending on the HTTP method, while using more than the GET and POST methods. That's highly misguided at best. We will first attempt to define REST and will look at what it means in the context of HTTP and the Web. For a more in-depth explanation of REST, you can read Roy T. REST principles https://ninenines.eu/docs/en/cowboy/2.5/guide/rest_principles/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/rest_principles/ This chapter will attempt to define the concepts behind REST and explain what makes a service RESTful. REST is often confused with performing a distinct operation depending on the HTTP method, while using more than the GET and POST methods. That's highly misguided at best. We will first attempt to define REST and will look at what it means in the context of HTTP and the Web. For a more in-depth explanation of REST, you can read Roy T. REST principles https://ninenines.eu/docs/en/cowboy/2.6/guide/rest_principles/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/rest_principles/ This chapter will attempt to define the concepts behind REST and explain what makes a service RESTful. REST is often confused with performing a distinct operation depending on the HTTP method, while using more than the GET and POST methods. That's highly misguided at best. We will first attempt to define REST and will look at what it means in the context of HTTP and the Web. For a more in-depth explanation of REST, you can read Roy T. REST handlers https://ninenines.eu/docs/en/cowboy/2.2/guide/rest_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/rest_handlers/ REST is implemented in Cowboy as a sub protocol. The request is handled as a state machine with many optional callbacks describing the resource and modifying the machine's behavior. The REST handler is the recommended way to handle HTTP requests. Initialization First, the init/2 callback is called. This callback is common to all handlers. To use REST for the current request, this function must return a cowboy_rest tuple. init(Req, State) -> {cowboy_rest, Req, State}. REST handlers https://ninenines.eu/docs/en/cowboy/2.3/guide/rest_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/rest_handlers/ REST is implemented in Cowboy as a sub protocol. The request is handled as a state machine with many optional callbacks describing the resource and modifying the machine's behavior. The REST handler is the recommended way to handle HTTP requests. Initialization First, the init/2 callback is called. This callback is common to all handlers. To use REST for the current request, this function must return a cowboy_rest tuple. init(Req, State) -> {cowboy_rest, Req, State}. REST handlers https://ninenines.eu/docs/en/cowboy/2.4/guide/rest_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/rest_handlers/ REST is implemented in Cowboy as a sub protocol. The request is handled as a state machine with many optional callbacks describing the resource and modifying the machine's behavior. The REST handler is the recommended way to handle HTTP requests. Initialization First, the init/2 callback is called. This callback is common to all handlers. To use REST for the current request, this function must return a cowboy_rest tuple. init(Req, State) -> {cowboy_rest, Req, State}. REST handlers https://ninenines.eu/docs/en/cowboy/2.5/guide/rest_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/rest_handlers/ REST is implemented in Cowboy as a sub protocol. The request is handled as a state machine with many optional callbacks describing the resource and modifying the machine's behavior. The REST handler is the recommended way to handle HTTP requests. Initialization First, the init/2 callback is called. This callback is common to all handlers. To use REST for the current request, this function must return a cowboy_rest tuple. init(Req, State) -> {cowboy_rest, Req, State}. REST handlers https://ninenines.eu/docs/en/cowboy/2.6/guide/rest_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/rest_handlers/ REST is implemented in Cowboy as a sub protocol. The request is handled as a state machine with many optional callbacks describing the resource and modifying the machine's behavior. The REST handler is the recommended way to handle HTTP requests. Initialization First, the init/2 callback is called. This callback is common to all handlers. To use REST for the current request, this function must return a cowboy_rest tuple. init(Req, State) -> {cowboy_rest, Req, State}. REST flowcharts https://ninenines.eu/docs/en/cowboy/2.2/guide/rest_flowcharts/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/rest_flowcharts/ This chapter will explain the REST handler state machine through a number of different diagrams. There are four main paths that requests may follow. One for the method OPTIONS; one for the methods GET and HEAD; one for the methods PUT, POST and PATCH; and one for the method DELETE. All paths start with the "Start" diagram, and all paths excluding the OPTIONS path go through the "Content negotiation" diagram and optionally the "Conditional requests" diagram if the resource exists. REST flowcharts https://ninenines.eu/docs/en/cowboy/2.3/guide/rest_flowcharts/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/rest_flowcharts/ This chapter will explain the REST handler state machine through a number of different diagrams. There are four main paths that requests may follow. One for the method OPTIONS; one for the methods GET and HEAD; one for the methods PUT, POST and PATCH; and one for the method DELETE. All paths start with the "Start" diagram, and all paths excluding the OPTIONS path go through the "Content negotiation" diagram and optionally the "Conditional requests" diagram if the resource exists. REST flowcharts https://ninenines.eu/docs/en/cowboy/2.4/guide/rest_flowcharts/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/rest_flowcharts/ This chapter will explain the REST handler state machine through a number of different diagrams. There are four main paths that requests may follow. One for the method OPTIONS; one for the methods GET and HEAD; one for the methods PUT, POST and PATCH; and one for the method DELETE. All paths start with the "Start" diagram, and all paths excluding the OPTIONS path go through the "Content negotiation" diagram and optionally the "Conditional requests" diagram if the resource exists. REST flowcharts https://ninenines.eu/docs/en/cowboy/2.5/guide/rest_flowcharts/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/rest_flowcharts/ This chapter will explain the REST handler state machine through a number of different diagrams. There are four main paths that requests may follow. One for the method OPTIONS; one for the methods GET and HEAD; one for the methods PUT, POST and PATCH; and one for the method DELETE. All paths start with the "Start" diagram, and all paths excluding the OPTIONS path go through the "Content negotiation" diagram and optionally the "Conditional requests" diagram if the resource exists. REST flowcharts https://ninenines.eu/docs/en/cowboy/2.6/guide/rest_flowcharts/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/rest_flowcharts/ This chapter will explain the REST handler state machine through a number of different diagrams. There are four main paths that requests may follow. One for the method OPTIONS; one for the methods GET and HEAD; one for the methods PUT, POST and PATCH; and one for the method DELETE. All paths start with the "Start" diagram, and all paths excluding the OPTIONS path go through the "Content negotiation" diagram and optionally the "Conditional requests" diagram if the resource exists. Designing a resource handler https://ninenines.eu/docs/en/cowboy/2.2/guide/resource_design/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/resource_design/ This chapter aims to provide you with a list of questions you must answer in order to write a good resource handler. It is meant to be usable as a step by step guide. The service Can the service become unavailable, and when it does, can we detect it? For example, database connectivity problems may be detected early. We may also have planned outages of all or parts of the system. Designing a resource handler https://ninenines.eu/docs/en/cowboy/2.3/guide/resource_design/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/resource_design/ This chapter aims to provide you with a list of questions you must answer in order to write a good resource handler. It is meant to be usable as a step by step guide. The service Can the service become unavailable, and when it does, can we detect it? For example, database connectivity problems may be detected early. We may also have planned outages of all or parts of the system. Designing a resource handler https://ninenines.eu/docs/en/cowboy/2.4/guide/resource_design/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/resource_design/ This chapter aims to provide you with a list of questions you must answer in order to write a good resource handler. It is meant to be usable as a step by step guide. The service Can the service become unavailable, and when it does, can we detect it? For example, database connectivity problems may be detected early. We may also have planned outages of all or parts of the system. Designing a resource handler https://ninenines.eu/docs/en/cowboy/2.5/guide/resource_design/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/resource_design/ This chapter aims to provide you with a list of questions you must answer in order to write a good resource handler. It is meant to be usable as a step by step guide. The service Can the service become unavailable, and when it does, can we detect it? For example, database connectivity problems may be detected early. We may also have planned outages of all or parts of the system. Designing a resource handler https://ninenines.eu/docs/en/cowboy/2.6/guide/resource_design/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/resource_design/ This chapter aims to provide you with a list of questions you must answer in order to write a good resource handler. It is meant to be usable as a step by step guide. The service Can the service become unavailable, and when it does, can we detect it? For example, database connectivity problems may be detected early. We may also have planned outages of all or parts of the system. The Websocket protocol https://ninenines.eu/docs/en/cowboy/2.2/guide/ws_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/ws_protocol/ This chapter explains what Websocket is and why it is a vital component of soft realtime Web applications. Description Websocket is an extension to HTTP that emulates plain TCP connections between the client, typically a Web browser, and the server. It uses the HTTP Upgrade mechanism to establish the connection. Websocket connections are fully asynchronous, unlike HTTP/1.1 (synchronous) and HTTP/2 (asynchronous, but the server can only initiate streams in response to requests). The Websocket protocol https://ninenines.eu/docs/en/cowboy/2.3/guide/ws_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/ws_protocol/ This chapter explains what Websocket is and why it is a vital component of soft realtime Web applications. Description Websocket is an extension to HTTP that emulates plain TCP connections between the client, typically a Web browser, and the server. It uses the HTTP Upgrade mechanism to establish the connection. Websocket connections are fully asynchronous, unlike HTTP/1.1 (synchronous) and HTTP/2 (asynchronous, but the server can only initiate streams in response to requests). The Websocket protocol https://ninenines.eu/docs/en/cowboy/2.4/guide/ws_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/ws_protocol/ This chapter explains what Websocket is and why it is a vital component of soft realtime Web applications. Description Websocket is an extension to HTTP that emulates plain TCP connections between the client, typically a Web browser, and the server. It uses the HTTP Upgrade mechanism to establish the connection. Websocket connections are fully asynchronous, unlike HTTP/1.1 (synchronous) and HTTP/2 (asynchronous, but the server can only initiate streams in response to requests). The Websocket protocol https://ninenines.eu/docs/en/cowboy/2.5/guide/ws_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/ws_protocol/ This chapter explains what Websocket is and why it is a vital component of soft realtime Web applications. Description Websocket is an extension to HTTP that emulates plain TCP connections between the client, typically a Web browser, and the server. It uses the HTTP Upgrade mechanism to establish the connection. Websocket connections are fully asynchronous, unlike HTTP/1.1 (synchronous) and HTTP/2 (asynchronous, but the server can only initiate streams in response to requests). The Websocket protocol https://ninenines.eu/docs/en/cowboy/2.6/guide/ws_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/ws_protocol/ This chapter explains what Websocket is and why it is a vital component of soft realtime Web applications. Description Websocket is an extension to HTTP that emulates plain TCP connections between the client, typically a Web browser, and the server. It uses the HTTP Upgrade mechanism to establish the connection. Websocket connections are fully asynchronous, unlike HTTP/1.1 (synchronous) and HTTP/2 (asynchronous, but the server can only initiate streams in response to requests). Websocket handlers https://ninenines.eu/docs/en/cowboy/2.2/guide/ws_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/ws_handlers/ Websocket handlers provide an interface for upgrading HTTP/1.1 connections to Websocket and sending or receiving frames on the Websocket connection. As Websocket connections are established through the HTTP/1.1 upgrade mechanism, Websocket handlers need to be able to first receive the HTTP request for the upgrade, before switching to Websocket and taking over the connection. They can then receive or send Websocket frames, handle incoming Erlang messages or close the connection. Websocket handlers https://ninenines.eu/docs/en/cowboy/2.3/guide/ws_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/ws_handlers/ Websocket handlers provide an interface for upgrading HTTP/1.1 connections to Websocket and sending or receiving frames on the Websocket connection. As Websocket connections are established through the HTTP/1.1 upgrade mechanism, Websocket handlers need to be able to first receive the HTTP request for the upgrade, before switching to Websocket and taking over the connection. They can then receive or send Websocket frames, handle incoming Erlang messages or close the connection. Websocket handlers https://ninenines.eu/docs/en/cowboy/2.4/guide/ws_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/ws_handlers/ Websocket handlers provide an interface for upgrading HTTP/1.1 connections to Websocket and sending or receiving frames on the Websocket connection. As Websocket connections are established through the HTTP/1.1 upgrade mechanism, Websocket handlers need to be able to first receive the HTTP request for the upgrade, before switching to Websocket and taking over the connection. They can then receive or send Websocket frames, handle incoming Erlang messages or close the connection. Websocket handlers https://ninenines.eu/docs/en/cowboy/2.5/guide/ws_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/ws_handlers/ Websocket handlers provide an interface for upgrading HTTP/1.1 connections to Websocket and sending or receiving frames on the Websocket connection. As Websocket connections are established through the HTTP/1.1 upgrade mechanism, Websocket handlers need to be able to first receive the HTTP request for the upgrade, before switching to Websocket and taking over the connection. They can then receive or send Websocket frames, handle incoming Erlang messages or close the connection. Websocket handlers https://ninenines.eu/docs/en/cowboy/2.6/guide/ws_handlers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/ws_handlers/ Websocket handlers provide an interface for upgrading HTTP/1.1 connections to Websocket and sending or receiving frames on the Websocket connection. As Websocket connections are established through the HTTP/1.1 upgrade mechanism, Websocket handlers need to be able to first receive the HTTP request for the upgrade, before switching to Websocket and taking over the connection. They can then receive or send Websocket frames, handle incoming Erlang messages or close the connection. Streams https://ninenines.eu/docs/en/cowboy/2.2/guide/streams/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/streams/ A stream is the set of messages that form an HTTP request/response pair. The term stream comes from HTTP/2. In Cowboy, it is also used when talking about HTTP/1.1 or HTTP/1.0. It should not be confused with streaming the request or response body. All versions of HTTP allow clients to initiate streams. HTTP/2 is the only one also allowing servers, through its server push feature. Both client and server-initiated streams go through the same process in Cowboy. Streams https://ninenines.eu/docs/en/cowboy/2.3/guide/streams/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/streams/ A stream is the set of messages that form an HTTP request/response pair. The term stream comes from HTTP/2. In Cowboy, it is also used when talking about HTTP/1.1 or HTTP/1.0. It should not be confused with streaming the request or response body. All versions of HTTP allow clients to initiate streams. HTTP/2 is the only one also allowing servers, through its server push feature. Both client and server-initiated streams go through the same process in Cowboy. Streams https://ninenines.eu/docs/en/cowboy/2.4/guide/streams/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/streams/ A stream is the set of messages that form an HTTP request/response pair. The term stream comes from HTTP/2. In Cowboy, it is also used when talking about HTTP/1.1 or HTTP/1.0. It should not be confused with streaming the request or response body. All versions of HTTP allow clients to initiate streams. HTTP/2 is the only one also allowing servers, through its server push feature. Both client and server-initiated streams go through the same process in Cowboy. Streams https://ninenines.eu/docs/en/cowboy/2.5/guide/streams/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/streams/ A stream is the set of messages that form an HTTP request/response pair. The term stream comes from HTTP/2. In Cowboy, it is also used when talking about HTTP/1.1 or HTTP/1.0. It should not be confused with streaming the request or response body. All versions of HTTP allow clients to initiate streams. HTTP/2 is the only one also allowing servers, through its server push feature. Both client and server-initiated streams go through the same process in Cowboy. Streams https://ninenines.eu/docs/en/cowboy/2.6/guide/streams/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/streams/ A stream is the set of messages that form an HTTP request/response pair. The term stream comes from HTTP/2. In Cowboy, it is also used when talking about HTTP/1.1 or HTTP/1.0. It should not be confused with streaming the request or response body. All versions of HTTP allow clients to initiate streams. HTTP/2 is the only one also allowing servers, through its server push feature. Both client and server-initiated streams go through the same process in Cowboy. Middlewares https://ninenines.eu/docs/en/cowboy/2.2/guide/middlewares/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/middlewares/ Cowboy delegates the request processing to middleware components. By default, two middlewares are defined, for the routing and handling of the request, as is detailed in most of this guide. Middlewares give you complete control over how requests are to be processed. You can add your own middlewares to the mix or completely change the chain of middlewares as needed. Cowboy will execute all middlewares in the given order, unless one of them decides to stop processing. Middlewares https://ninenines.eu/docs/en/cowboy/2.3/guide/middlewares/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/middlewares/ Cowboy delegates the request processing to middleware components. By default, two middlewares are defined, for the routing and handling of the request, as is detailed in most of this guide. Middlewares give you complete control over how requests are to be processed. You can add your own middlewares to the mix or completely change the chain of middlewares as needed. Cowboy will execute all middlewares in the given order, unless one of them decides to stop processing. Middlewares https://ninenines.eu/docs/en/cowboy/2.4/guide/middlewares/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/middlewares/ Cowboy delegates the request processing to middleware components. By default, two middlewares are defined, for the routing and handling of the request, as is detailed in most of this guide. Middlewares give you complete control over how requests are to be processed. You can add your own middlewares to the mix or completely change the chain of middlewares as needed. Cowboy will execute all middlewares in the given order, unless one of them decides to stop processing. Middlewares https://ninenines.eu/docs/en/cowboy/2.5/guide/middlewares/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/middlewares/ Cowboy delegates the request processing to middleware components. By default, two middlewares are defined, for the routing and handling of the request, as is detailed in most of this guide. Middlewares give you complete control over how requests are to be processed. You can add your own middlewares to the mix or completely change the chain of middlewares as needed. Cowboy will execute all middlewares in the given order, unless one of them decides to stop processing. Middlewares https://ninenines.eu/docs/en/cowboy/2.6/guide/middlewares/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/middlewares/ Cowboy delegates the request processing to middleware components. By default, two middlewares are defined, for the routing and handling of the request, as is detailed in most of this guide. Middlewares give you complete control over how requests are to be processed. You can add your own middlewares to the mix or completely change the chain of middlewares as needed. Cowboy will execute all middlewares in the given order, unless one of them decides to stop processing. Changes since Cowboy 2.2 https://ninenines.eu/docs/en/cowboy/2.2/guide/migrating_from_2.2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/migrating_from_2.2/ The following patch versions were released since Cowboy 2.2: Cowboy 2.2.2 While fixing the miscount in the previous patch release an issue was introduced where HTTP/2 bodies could be sent out of orders when using iolists. This has been corrected. Cowboy 2.2.1 Colons are now allowed within path segments in routes provided to cowboy_router:compile/1 as long as they are not the first character of the path segment. The cowboy_req:delete_resp_header/2 function will no longer crash when no response header was set before calling it. Changes since Cowboy 2.6 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.6/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.6/ The following patch versions were released since Cowboy 2.6: Cowboy 2.6.3 This release updates Cowlib to 2.7.3 to fix the vsn value in the cowlib.app file that was causing issues to Elixir users. Cowboy 2.6.2 This release updates Cowlib to 2.7.2. A bug in the HTTP/2 code that resulted in the failure to fully send iolist response bodies has been fixed. Cowboy would just wait indefinitely in those cases. Cowboy will now use the host header when the HTTP/2 :authority pseudo header is missing. Migrating from Cowboy 2.2 to 2.3 https://ninenines.eu/docs/en/cowboy/2.3/guide/migrating_from_2.2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/migrating_from_2.2/ Cowboy 2.3 focused on making the Cowboy processes behave properly according to OTP principles. This version is a very good milestone toward that goal and most of everything should now work. Release upgrades and a few details will be improved in future versions. Features added Add support for all functions from the module sys. Note that Cowboy currently does not implement the sys debugging mechanisms as tracing is recommended instead. Add a max_frame_size option for Websocket handlers to close the connection when the client attempts to send a frame that's too large. Migrating from Cowboy 2.3 to 2.4 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_2.3/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_2.3/ Cowboy 2.4 focused on improving the HTTP/2 implementation. All existing tests from RFC7540 and the h2spec test suite now all pass. Numerous options have been added to control SETTINGS and related behavior. In addition experimental support for Websocket over HTTP/2 was added. Features added Add experimental support for Websocket over HTTP/2. You can use the enable_connect_protocol option to enable. It implements the following draft: https://tools.ietf.org/html/draft-ietf-httpbis-h2-websockets-01 Add options max_decode_table_size and max_encode_table_size to restrict the size of the HPACK compression dictionary. Migrating from Cowboy 2.4 to 2.5 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.4/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.4/ Cowboy 2.5 focused on making the test suites pass. A variety of new features, fixes and improvements have also been worked on. Features added Add option linger_timeout to control how long Cowboy will wait before closing the socket when shutting down the connection. This helps avoid the TCP reset problem HTTP/1.1 suffers from. The default is now 1000 ms. It is now possible to stream a response body without using chunked transfer-encoding when the protocol is HTTP/1. Migrating from Cowboy 2.1 to 2.2 https://ninenines.eu/docs/en/cowboy/2.2/guide/migrating_from_2.1/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/migrating_from_2.1/ Cowboy 2.2 focused on adding features required for writing gRPC servers and on completing test suites for the core HTTP RFCs, fixing many bugs along the way. Features added Add support for sending trailers at the end of response bodies. Trailers are additional header fields that may be sent after the body to add more information to the response. Their usage is required in gRPC servers. They are optional and may be discarded in other scenarios (for example if the request goes through an HTTP/1. Migrating from Cowboy 2.1 to 2.2 https://ninenines.eu/docs/en/cowboy/2.3/guide/migrating_from_2.1/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/migrating_from_2.1/ Cowboy 2.2 focused on adding features required for writing gRPC servers and on completing test suites for the core HTTP RFCs, fixing many bugs along the way. Features added Add support for sending trailers at the end of response bodies. Trailers are additional header fields that may be sent after the body to add more information to the response. Their usage is required in gRPC servers. They are optional and may be discarded in other scenarios (for example if the request goes through an HTTP/1. Migrating from Cowboy 2.2 to 2.3 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_2.2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_2.2/ Cowboy 2.3 focused on making the Cowboy processes behave properly according to OTP principles. This version is a very good milestone toward that goal and most of everything should now work. Release upgrades and a few details will be improved in future versions. Features added Add support for all functions from the module sys. Note that Cowboy currently does not implement the sys debugging mechanisms as tracing is recommended instead. Add a max_frame_size option for Websocket handlers to close the connection when the client attempts to send a frame that's too large. Migrating from Cowboy 2.3 to 2.4 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.3/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.3/ Cowboy 2.4 focused on improving the HTTP/2 implementation. All existing tests from RFC7540 and the h2spec test suite now all pass. Numerous options have been added to control SETTINGS and related behavior. In addition experimental support for Websocket over HTTP/2 was added. Features added Add experimental support for Websocket over HTTP/2. You can use the enable_connect_protocol option to enable. It implements the following draft: https://tools.ietf.org/html/draft-ietf-httpbis-h2-websockets-01 Add options max_decode_table_size and max_encode_table_size to restrict the size of the HPACK compression dictionary. Migrating from Cowboy 2.5 to 2.6 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.5/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.5/ Cowboy 2.6 greatly refactored the HTTP/2 code, a large part of which was moved to Cowlib and is now used by both the Cowboy server and the Gun client. A large number of tickets were also closed which resulted in many bugs fixed and many features and options added, although some of them are still experimental. Features added Add support for the PROXY protocol header. It can be enabled via the proxy_header option. Migrating from Cowboy 2.0 to 2.1 https://ninenines.eu/docs/en/cowboy/2.2/guide/migrating_from_2.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/migrating_from_2.0/ Cowboy 2.1 focused on adding features that were temporarily removed in Cowboy 2.0. A number of bugs found in the 2.0 release were also fixed. Features added It is now possible to obtain the client TLS certificate and the local IP/port for the connection from the Req object. Informational responses (1XX responses) can now be sent. They must be sent before initiating the final response. The expect: 100-continue header is now handled automatically. Migrating from Cowboy 2.0 to 2.1 https://ninenines.eu/docs/en/cowboy/2.3/guide/migrating_from_2.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/migrating_from_2.0/ Cowboy 2.1 focused on adding features that were temporarily removed in Cowboy 2.0. A number of bugs found in the 2.0 release were also fixed. Features added It is now possible to obtain the client TLS certificate and the local IP/port for the connection from the Req object. Informational responses (1XX responses) can now be sent. They must be sent before initiating the final response. The expect: 100-continue header is now handled automatically. Migrating from Cowboy 2.1 to 2.2 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_2.1/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_2.1/ Cowboy 2.2 focused on adding features required for writing gRPC servers and on completing test suites for the core HTTP RFCs, fixing many bugs along the way. Features added Add support for sending trailers at the end of response bodies. Trailers are additional header fields that may be sent after the body to add more information to the response. Their usage is required in gRPC servers. They are optional and may be discarded in other scenarios (for example if the request goes through an HTTP/1. Migrating from Cowboy 2.2 to 2.3 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.2/ Cowboy 2.3 focused on making the Cowboy processes behave properly according to OTP principles. This version is a very good milestone toward that goal and most of everything should now work. Release upgrades and a few details will be improved in future versions. Features added Add support for all functions from the module sys. Note that Cowboy currently does not implement the sys debugging mechanisms as tracing is recommended instead. Add a max_frame_size option for Websocket handlers to close the connection when the client attempts to send a frame that's too large. Migrating from Cowboy 2.4 to 2.5 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.4/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.4/ Cowboy 2.5 focused on making the test suites pass. A variety of new features, fixes and improvements have also been worked on. Features added Add option linger_timeout to control how long Cowboy will wait before closing the socket when shutting down the connection. This helps avoid the TCP reset problem HTTP/1.1 suffers from. The default is now 1000 ms. It is now possible to stream a response body without using chunked transfer-encoding when the protocol is HTTP/1. Migrating from Cowboy 1.0 to 2.0 https://ninenines.eu/docs/en/cowboy/2.2/guide/migrating_from_1.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/migrating_from_1.0/ A lot has changed between Cowboy 1.0 and 2.0. The cowboy_req interface in particular has seen a massive revamp. Hooks are gone, their functionality can now be achieved via stream handlers. The documentation has seen great work, in particular the manual. Each module and each function now has its own dedicated manual page with full details and examples. Compatibility Compatibility with Erlang/OTP R16, 17 and 18 has been dropped. Erlang/OTP 19. Migrating from Cowboy 1.0 to 2.0 https://ninenines.eu/docs/en/cowboy/2.3/guide/migrating_from_1.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/migrating_from_1.0/ A lot has changed between Cowboy 1.0 and 2.0. The cowboy_req interface in particular has seen a massive revamp. Hooks are gone, their functionality can now be achieved via stream handlers. The documentation has seen great work, in particular the manual. Each module and each function now has its own dedicated manual page with full details and examples. Compatibility Compatibility with Erlang/OTP R16, 17 and 18 has been dropped. Erlang/OTP 19. Migrating from Cowboy 2.0 to 2.1 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_2.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_2.0/ Cowboy 2.1 focused on adding features that were temporarily removed in Cowboy 2.0. A number of bugs found in the 2.0 release were also fixed. Features added It is now possible to obtain the client TLS certificate and the local IP/port for the connection from the Req object. Informational responses (1XX responses) can now be sent. They must be sent before initiating the final response. The expect: 100-continue header is now handled automatically. Migrating from Cowboy 2.1 to 2.2 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.1/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.1/ Cowboy 2.2 focused on adding features required for writing gRPC servers and on completing test suites for the core HTTP RFCs, fixing many bugs along the way. Features added Add support for sending trailers at the end of response bodies. Trailers are additional header fields that may be sent after the body to add more information to the response. Their usage is required in gRPC servers. They are optional and may be discarded in other scenarios (for example if the request goes through an HTTP/1. Migrating from Cowboy 2.3 to 2.4 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.3/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.3/ Cowboy 2.4 focused on improving the HTTP/2 implementation. All existing tests from RFC7540 and the h2spec test suite now all pass. Numerous options have been added to control SETTINGS and related behavior. In addition experimental support for Websocket over HTTP/2 was added. Features added Add experimental support for Websocket over HTTP/2. You can use the enable_connect_protocol option to enable. It implements the following draft: https://tools.ietf.org/html/draft-ietf-httpbis-h2-websockets-01 Add options max_decode_table_size and max_encode_table_size to restrict the size of the HPACK compression dictionary. HTTP and other specifications https://ninenines.eu/docs/en/cowboy/2.2/guide/specs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/specs/ This chapter intends to list all the specification documents for or related to HTTP. HTTP IANA Registries HTTP Method Registry HTTP Status Code Registry Message Headers HTTP Parameters HTTP Alt-Svc Parameter Registry HTTP Authentication Scheme Registry HTTP Cache Directive Registry HTTP Digest Algorithm Values HTTP Origin-Bound Authentication Device Identifier Types HTTP Upgrade Token Registry HTTP Warn Codes HTTP/2 Parameters WebSocket Protocol Registries Current CORS: Cross-Origin Resource Sharing CSP2: Content Security Policy Level 2 DNT: Tracking Preference Expression (DNT) eventsource: Server-Sent Events Form content types: Form content types Preload: Preload REST: Fielding's Dissertation RFC 1945: HTTP/1. HTTP and other specifications https://ninenines.eu/docs/en/cowboy/2.3/guide/specs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/specs/ This chapter intends to list all the specification documents for or related to HTTP. HTTP IANA Registries HTTP Method Registry HTTP Status Code Registry Message Headers HTTP Parameters HTTP Alt-Svc Parameter Registry HTTP Authentication Scheme Registry HTTP Cache Directive Registry HTTP Digest Algorithm Values HTTP Origin-Bound Authentication Device Identifier Types HTTP Upgrade Token Registry HTTP Warn Codes HTTP/2 Parameters WebSocket Protocol Registries Current CORS: Cross-Origin Resource Sharing CSP2: Content Security Policy Level 2 DNT: Tracking Preference Expression (DNT) eventsource: Server-Sent Events Form content types: Form content types Preload: Preload PROXY: The PROXY protocol REST: Fielding's Dissertation RFC 1945: HTTP/1. Migrating from Cowboy 1.0 to 2.0 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_1.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/migrating_from_1.0/ A lot has changed between Cowboy 1.0 and 2.0. The cowboy_req interface in particular has seen a massive revamp. Hooks are gone, their functionality can now be achieved via stream handlers. The documentation has seen great work, in particular the manual. Each module and each function now has its own dedicated manual page with full details and examples. Compatibility Compatibility with Erlang/OTP R16, 17 and 18 has been dropped. Erlang/OTP 19. Migrating from Cowboy 2.0 to 2.1 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_2.0/ Cowboy 2.1 focused on adding features that were temporarily removed in Cowboy 2.0. A number of bugs found in the 2.0 release were also fixed. Features added It is now possible to obtain the client TLS certificate and the local IP/port for the connection from the Req object. Informational responses (1XX responses) can now be sent. They must be sent before initiating the final response. The expect: 100-continue header is now handled automatically. Migrating from Cowboy 2.2 to 2.3 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.2/ Cowboy 2.3 focused on making the Cowboy processes behave properly according to OTP principles. This version is a very good milestone toward that goal and most of everything should now work. Release upgrades and a few details will be improved in future versions. Features added Add support for all functions from the module sys. Note that Cowboy currently does not implement the sys debugging mechanisms as tracing is recommended instead. Add a max_frame_size option for Websocket handlers to close the connection when the client attempts to send a frame that's too large. HTTP and other specifications https://ninenines.eu/docs/en/cowboy/2.4/guide/specs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/specs/ This chapter intends to list all the specification documents for or related to HTTP. HTTP IANA Registries HTTP Method Registry HTTP Status Code Registry Message Headers HTTP Parameters HTTP Alt-Svc Parameter Registry HTTP Authentication Scheme Registry HTTP Cache Directive Registry HTTP Digest Algorithm Values HTTP Origin-Bound Authentication Device Identifier Types HTTP Upgrade Token Registry HTTP Warn Codes HTTP/2 Parameters WebSocket Protocol Registries Current CORS: Cross-Origin Resource Sharing CSP2: Content Security Policy Level 2 DNT: Tracking Preference Expression (DNT) eventsource: Server-Sent Events Form content types: Form content types Preload: Preload PROXY: The PROXY protocol REST: Fielding's Dissertation RFC 1945: HTTP/1. Migrating from Cowboy 1.0 to 2.0 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_1.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/migrating_from_1.0/ A lot has changed between Cowboy 1.0 and 2.0. The cowboy_req interface in particular has seen a massive revamp. Hooks are gone, their functionality can now be achieved via stream handlers. The documentation has seen great work, in particular the manual. Each module and each function now has its own dedicated manual page with full details and examples. Compatibility Compatibility with Erlang/OTP R16, 17 and 18 has been dropped. Erlang/OTP 19. Migrating from Cowboy 2.1 to 2.2 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.1/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.1/ Cowboy 2.2 focused on adding features required for writing gRPC servers and on completing test suites for the core HTTP RFCs, fixing many bugs along the way. Features added Add support for sending trailers at the end of response bodies. Trailers are additional header fields that may be sent after the body to add more information to the response. Their usage is required in gRPC servers. They are optional and may be discarded in other scenarios (for example if the request goes through an HTTP/1. HTTP and other specifications https://ninenines.eu/docs/en/cowboy/2.5/guide/specs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/specs/ This chapter intends to list all the specification documents for or related to HTTP. HTTP IANA Registries HTTP Method Registry HTTP Status Code Registry Message Headers HTTP Parameters HTTP Alt-Svc Parameter Registry HTTP Authentication Scheme Registry HTTP Cache Directive Registry HTTP Digest Algorithm Values HTTP Origin-Bound Authentication Device Identifier Types HTTP Upgrade Token Registry HTTP Warn Codes HTTP/2 Parameters WebSocket Protocol Registries Current CORS: Cross-Origin Resource Sharing CSP2: Content Security Policy Level 2 DNT: Tracking Preference Expression (DNT) eventsource: Server-Sent Events Form content types: Form content types Preload: Preload PROXY: The PROXY protocol REST: Fielding's Dissertation RFC 1945: HTTP/1. Migrating from Cowboy 2.0 to 2.1 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_2.0/ Cowboy 2.1 focused on adding features that were temporarily removed in Cowboy 2.0. A number of bugs found in the 2.0 release were also fixed. Features added It is now possible to obtain the client TLS certificate and the local IP/port for the connection from the Req object. Informational responses (1XX responses) can now be sent. They must be sent before initiating the final response. The expect: 100-continue header is now handled automatically. Migrating from Cowboy 1.0 to 2.0 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_1.0/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/migrating_from_1.0/ A lot has changed between Cowboy 1.0 and 2.0. The cowboy_req interface in particular has seen a massive revamp. Hooks are gone, their functionality can now be achieved via stream handlers. The documentation has seen great work, in particular the manual. Each module and each function now has its own dedicated manual page with full details and examples. Compatibility Compatibility with Erlang/OTP R16, 17 and 18 has been dropped. Erlang/OTP 19. HTTP and other specifications https://ninenines.eu/docs/en/cowboy/2.6/guide/specs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/specs/ This chapter intends to list all the specification documents for or related to HTTP. HTTP IANA Registries HTTP Method Registry HTTP Status Code Registry Message Headers HTTP Parameters HTTP Alt-Svc Parameter Registry HTTP Authentication Scheme Registry HTTP Cache Directive Registry HTTP Digest Algorithm Values HTTP Origin-Bound Authentication Device Identifier Types HTTP Upgrade Token Registry HTTP Warn Codes HTTP/2 Parameters WebSocket Protocol Registries Current CORS: Cross-Origin Resource Sharing CSP2: Content Security Policy Level 2 DNT: Tracking Preference Expression (DNT) eventsource: Server-Sent Events Form content types: Form content types Preload: Preload PROXY: The PROXY protocol REST: Fielding's Dissertation RFC 1945: HTTP/1. Ranch 2.0 release candidate 1 https://ninenines.eu/articles/ranch-2.0.0-rc.1/ Thu, 18 Jul 2019 07:00:00 +0100 https://ninenines.eu/articles/ranch-2.0.0-rc.1/ Ranch 2.0.0-rc.1 has been released! We are getting very close to releasing Ranch 2.0! As most of the tremendous programming work was done by contributor Jan Uhlig, I will yield the floor and let him describe what went into this great release. In Ranch 1.x, there is only one supervisor per Ranch listener to start and manage connection processes. Under high load (many clients rapidly connecting and/or disconnecting), the message queue of this one supervisor could becomes congested, leading to declining accept rates or a stalled listener. Joe Armstrong the rubber duck https://ninenines.eu/articles/joe_the_rubber_duck/ Tue, 11 Jun 2019 07:00:00 +0100 https://ninenines.eu/articles/joe_the_rubber_duck/ Joe Armstrong passed away a couple months ago. This was a sad day, completely unexpected to me, and he will be sorely missed. Great eulogies were written. My most striking memory of Joe was during dinner at his place after a conference in Stockholm many years ago. Joe was describing his rubber duck debugging method and introduced us to his famous rubber duck. "When you can't figure it out, ask the duck! Merry Christmas 2018: A Recap https://ninenines.eu/articles/merry-christmas-2018/ Tue, 25 Dec 2018 07:00:00 +0100 https://ninenines.eu/articles/merry-christmas-2018/ As the year 2018 ends it's time for a short recap and a look forward for the next year. Overall, more than half of all open tickets have been closed. Most tickets were opened since 2015 and I couldn't get to those, but now that pre-school started I have a lot more time! I'm aiming to keep the number of tickets below 100 across all my projects. Cowboy 2.x is now mature. Cowboy 2.6 https://ninenines.eu/articles/cowboy-2.6.0/ Mon, 19 Nov 2018 07:00:00 +0100 https://ninenines.eu/articles/cowboy-2.6.0/ Cowboy 2.6.0 has been released! Cowboy 2.6 greatly refactored the HTTP/2 code, a large part of which was moved to Cowlib and is now used by both the Cowboy server and the Gun client. A large number of tickets were also closed which resulted in many bugs fixed and many features and options added, although some of them are still experimental. Of note is the support for the PROXY protocol header built directly into Cowboy; the ability to use the sendfile tuple to send files while streaming a response body (for example you could build a tar file on the fly); and experimental support for range requests in the REST and static file handlers, including an automatic mode that lets you enable byte range requests to existing handlers with what's basically a one-liner. Ranch 1.7 https://ninenines.eu/articles/ranch-1.7.0/ Wed, 14 Nov 2018 10:00:00 +0100 https://ninenines.eu/articles/ranch-1.7.0/ Ranch 1.7.0 has been released! This release adds built-in support for the PROXY protocol. The PROXY protocol is a simple and efficient way for proxies to transmit information about the client. While a third-party library already existed, it was not entirely compatible with the Ranch interface, in particular when socket active mode was involved. This new implementation fixes that and supports the full protocol with as little overhead as possible compared to normal operations: just one extra function call. Cowboy 2.5 https://ninenines.eu/articles/cowboy-2.5.0/ Wed, 03 Oct 2018 07:00:00 +0100 https://ninenines.eu/articles/cowboy-2.5.0/ Cowboy 2.5.0 has been released! Cowboy 2.5 focused on making the test suites pass. It is now possible to get all the Cowboy tests to pass successfully, at least on Linux and on the more recent Erlang/OTP versions. HTTP/1.1 has been improved with a fix for the TCP reset problem and the ability to stream a response body without using chunked transfer-encoding. Two functions have been added: cowboy_req:stream_events/3 encodes and streams one or more text/event-stream events, and cowboy_req:read_and_match_urlencoded_body/2,3 reads, parses and matches application/x-www-form-urlencoded request bodies. Gun 1.3 https://ninenines.eu/articles/gun-1.3.0/ Mon, 01 Oct 2018 10:00:00 +0100 https://ninenines.eu/articles/gun-1.3.0/ Gun 1.3.0 has been released! Gun is an HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP. This release improves the CONNECT support introduced in the previous version and adds built-in Websocket protocol negotiation. A complete list of changes can be found in the migration guide: Migrating from Gun 1.2 to 1.3. You can donate to this project via BountySource. These funds are used to pay for additional servers for testing. And healthy food. Gun 1.2 https://ninenines.eu/articles/gun-1.2.0/ Mon, 17 Sep 2018 10:00:00 +0100 https://ninenines.eu/articles/gun-1.2.0/ Gun 1.2.0 has been released! Gun is an HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP. Gun now supports issuing CONNECT requests to HTTP proxies in order to establish tunnels to origin servers. Gun can establish tunnels over one or more proxies as necessary. All existing protocols can be used inside the tunnel, including HTTP/1.1, HTTP/2 and Websocket over both TCP and TLS connections. Note that it is currently not possible to tunnel a TLS connection via an HTTPS proxy due to limitations in the current version of Erlang/OTP. Ranch 1.6 https://ninenines.eu/articles/ranch-1.6.0/ Wed, 01 Aug 2018 10:00:00 +0100 https://ninenines.eu/articles/ranch-1.6.0/ Ranch 1.6.0 has been released! This release sees the introduction of a suspend/resume mechanism for the listeners which makes the listener close the listening socket and stop accepting new connections. Existing connections continue uninterrupted. This can be used to update the socket options of the listener, or to implement a graceful shutdown. To that end a function has also been added which allows waiting until connections reach a certain number. Gun 1.0 https://ninenines.eu/articles/gun-1.0.0/ Fri, 27 Jul 2018 10:00:00 +0100 https://ninenines.eu/articles/gun-1.0.0/ Gun 1.0.0 has been released! Gun is an HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP. Gun provides an asynchronous interface and will keep the connection open to the server, reconnecting as necessary. Gun has existed for many years as the test client for Cowboy and is now mature enough to receive a proper version. Gun is battle tested by customers and other users but is not the most well tested client there is. Asciideck: Asciidoc for Erlang https://ninenines.eu/articles/asciideck/ Wed, 13 Jun 2018 07:00:00 +0100 https://ninenines.eu/articles/asciideck/ Asciideck is a new project I have been working on in my spare time that implements an Asciidoc parser and translation of Asciidoc documents into various output formats. The Asciideck parser returns an AST for the document. That AST can be further manipulated should it be necessary: for example you may need to rewrite some relative links if you are not keeping the same file directory structure as the original Asciidoc documents. Gun 1.0 release candidate 1 https://ninenines.eu/articles/gun-1.0.0-rc.1/ Mon, 04 Jun 2018 10:00:00 +0100 https://ninenines.eu/articles/gun-1.0.0-rc.1/ Gun 1.0.0-rc.1 has been released! Gun is an HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP. Gun provides an asynchronous interface and will keep the connection open to the server, reconnecting as necessary. Gun has existed for many years as the test client for Cowboy and is now mature enough to receive a proper version. Gun is battle tested by customers and other users but is not the most well tested client there is. Cowboy 2.4 https://ninenines.eu/articles/cowboy-2.4.0/ Wed, 02 May 2018 10:00:00 +0100 https://ninenines.eu/articles/cowboy-2.4.0/ Cowboy 2.4.0 has been released! Numerous HTTP/2 options have been added to control the HTTP/2 SETTINGS and general behavior of HTTP/2 connections. The options for initial window sizes, maximum frame sizes or compression table sizes might be of interest for optimizing the performance of HTTP/2 connections. Experimental support for Websocket over HTTP/2 was added. Note that browsers do not currently support it. The only browser with partial support is Google Chrome 67 (dev build) started with a specific flag. Cowboy 2.3 https://ninenines.eu/articles/cowboy-2.3.0/ Wed, 04 Apr 2018 12:00:00 +0100 https://ninenines.eu/articles/cowboy-2.3.0/ Cowboy 2.3.0 has been released! This release focused on adding support for the functions from the sys module for introspecting Cowboy processes. Many bugs have also been fixed. A more complete list of changes can be found in the migration guide: Migrating from Cowboy 2.2 to 2.3. You can donate to this project via BountySource because I need to eat snacks when I write code. Thanks in advance! As usual, feedback is appreciated, and issues should be reported by opening a ticket. Cowboy 2.2 https://ninenines.eu/articles/cowboy-2.2.0/ Wed, 13 Dec 2017 12:00:00 +0100 https://ninenines.eu/articles/cowboy-2.2.0/ Cowboy 2.2.0 has been released! This release focused on adding features required for writing gRPC servers and on completing test suites for the core HTTP RFCs. The cowboy_req:stream_trailers/2 function has been added. It terminates the streamed response by adding some trailer field values. This feature is required for gRPC. The max_skip_body_length option was added. It controls how much of the request body we are willing to skip to get to the next request for HTTP/1. Cowboy 2.1 https://ninenines.eu/articles/cowboy-2.1.0/ Thu, 09 Nov 2017 12:00:00 +0100 https://ninenines.eu/articles/cowboy-2.1.0/ Cowboy 2.1.0 has been released! This release focused on adding features that were temporarily removed during the 2.0 release process: The client TLS certificate can now be obtained. The 100 Continue response is now sent automatically again when necessary. NEW: It is now possible to send informational responses (1XX) directly from user code via the cowboy_req:inform/2,3 functions. NEW: cowboy_rest handlers can now switch to any other type of handler from almost any callback. Cowboy 2.0 https://ninenines.eu/articles/cowboy-2.0.0/ Wed, 04 Oct 2017 12:00:00 +0100 https://ninenines.eu/articles/cowboy-2.0.0/ Cowboy 2.0.0 has been released! This is the new stable version of Cowboy. There are no new releases planned for the 1.x version of Cowboy. The highlights from the release are: HTTP/2 support! Websocket compression! Much simpler, cleaner interface. No more weird errors just because you discard the Req object. A new low-level interface that receives all events from every set of request and response. This replaces the awkward hooks from 1. Cowboy 2.0 release candidate 2 https://ninenines.eu/articles/cowboy-2.0.0-rc.2/ Wed, 23 Aug 2017 18:00:00 +0100 https://ninenines.eu/articles/cowboy-2.0.0-rc.2/ Cowboy 2.0.0-rc.2 has been released! This is the new recommended version of Cowboy. Its API should not change before release. While you probably should not use it in production yet, many do successfully. Use at your own risk. This new version contains fixes for the following issues: HTTP/2 server push was using the wrong header compression context. HTTP/2 flow control could end up queueing data in the wrong order when resuming the sending of data. Cowboy 2.0 release candidate 1 https://ninenines.eu/articles/cowboy-2.0.0-rc.1/ Mon, 24 Jul 2017 18:00:00 +0100 https://ninenines.eu/articles/cowboy-2.0.0-rc.1/ Cowboy 2.0.0-rc.1 has been released! This is the new recommended version of Cowboy. Its API should not change before release. While you probably should not use it in production yet, many do successfully. Use at your own risk. The plan is to have a new RC version every couple weeks until the summer ends or later if there are still blocking issues open. Only issues that can't be fixed without making breaking changes to the interface may block the release. The elephant in the room https://ninenines.eu/articles/the-elephant-in-the-room/ Sun, 26 Mar 2017 00:00:00 +0100 https://ninenines.eu/articles/the-elephant-in-the-room/ Have you ever tried telling someone why they should use Erlang? You boast the smaller code size, the auto healing mechanisms, the distribution and they seem really excited. They wonder why they never heard about Erlang before. And then you show them what the code looks like. All excitement goes away. The smiles disappear. Their face starts becoming really serious. You lost them. You know you lost them. They comment on the syntax, or perhaps you do, already admitting defeat. Don't let it crash https://ninenines.eu/articles/dont-let-it-crash/ Sun, 22 Jan 2017 00:00:00 +0100 https://ninenines.eu/articles/dont-let-it-crash/ We have a specific mindset when writing Erlang programs. We focus on the normal execution of the program and don't handle most of the errors that may occur. We sometimes call this normal execution the happy path. The general pattern behind writing only for the happy path, letting the VM catch errors (writing them to a log for future consumption) and then having a supervisor restart the processes that failed from a clean state, has a name. Cowboy 2.0 pre-release 4 https://ninenines.eu/articles/cowboy-2.0.0-pre.4/ Tue, 03 Jan 2017 00:00:00 +0100 https://ninenines.eu/articles/cowboy-2.0.0-pre.4/ Cowboy 2.0.0-pre.4 has been released! This is the new recommended version of Cowboy. While I would not recommend putting it in production just yet, I do recommend you start writing new applications with this Cowboy version. The most significant changes in the pre-release are: A new architecture: there now is one process per connection and one process per request. This was done because HTTP/2 allows running requests concurrently. Stream handlers. Ranch 1.3 https://ninenines.eu/articles/ranch-1.3/ Mon, 28 Nov 2016 00:00:00 +0100 https://ninenines.eu/articles/ranch-1.3/ Ranch 1.3.0 has been released! This release fixes a number of long standing issues and adds a small number of features: The ssl application has been added to the list of dependencies. If you don't need it, you can remove it automatically when fetching Ranch or when building the release. If you do need it, you will no longer have issues shutting down a node because of Ranch. The ranch:info/0 and ranch:procs/2 can be used to retrieve information about Ranch's state. Mailing list archived https://ninenines.eu/articles/ml-archives/ Mon, 29 Aug 2016 00:00:00 +0100 https://ninenines.eu/articles/ml-archives/ The old mailing list archives have been added to the site, mainly for referencing purposes. The mailing list has been shut down and all personal information has been deleted. If you need help with a project, consider either opening a ticket on that project's issues tracker or going through the community channels (erlang-questions, #ninenines or #erlang on Freenode). Prefer tickets; often when people have issues it highlights an underlying problem in the project or its documentation. Website update https://ninenines.eu/articles/website-update/ Sat, 02 Apr 2016 00:00:00 +0100 https://ninenines.eu/articles/website-update/ Last week-end I updated the Nine Nines website. I switched to Hugo. The site is now built from Asciidoc documents. You probably saw me switch to Asciidoc for documentation this past year. This is the natural conclusion to that story. The great thing is that with a little bit of Makefile magic I can just copy the documentation files into Hugo and poof, they appear on the website. I am very happy with that new setup. The Erlanger Playbook September 2015 Update https://ninenines.eu/articles/erlanger-playbook-september-2015-update/ Wed, 02 Sep 2015 00:00:00 +0100 https://ninenines.eu/articles/erlanger-playbook-september-2015-update/ An update to The Erlanger Playbook is now available! The Erlanger Playbook is a book about software development using Erlang. It currently covers all areas from the conception, design, the writing of code, documentation and tests. The book is still a work in progress. Future topics will include refactoring, debugging and tracing, benchmarking, releases, community management (for open source projects). This update fixes a number of things and adds two chapters: IOlists and Erlang building blocks. Consulting & Training https://ninenines.eu/services/ Wed, 01 Jul 2015 00:00:00 +0100 https://ninenines.eu/services/ If you are interested by any of these opportunities, send me an email. Consulting You can get me, Loïc Hoguin, author of Cowboy, to help you solve a problem or work on a particular project. My area of expertise is Erlang; HTTP, Websocket and REST APIs; design and implementation of protocols; and messaging systems. I can also be helpful with testing or code reviews. I offer both hourly and daily rates: Documentation https://ninenines.eu/docs/ Wed, 01 Jul 2015 00:00:00 +0100 https://ninenines.eu/docs/ Contribute Do you have examples, tutorials, videos about one or more of my projects? I would happily include them on this page. Send me an email with the details. Donate https://ninenines.eu/donate/ Wed, 01 Jul 2015 00:00:00 +0100 https://ninenines.eu/donate/ Like my work? Donate! Donate to Loïc Hoguin because his work on Cowboy, Ranch, Gun and Erlang.mk is fantastic: Recurring payment options are also available via BountySource. These funds are used to cover the recurring expenses like dedicated servers or domain names. Public talks https://ninenines.eu/talks/ Wed, 01 Jul 2015 00:00:00 +0100 https://ninenines.eu/talks/ Talk requests Organizing a conference and in need of a speaker for a talk about Erlang and the Web? Need an introduction to Erlang/OTP for your company? Looking for a cool subject for a user group meeting? Send me an email with the details. Slogan https://ninenines.eu/slogan/ Wed, 01 Jul 2015 00:00:00 +0100 https://ninenines.eu/slogan/ Feeling generous? Love reading?Crowdfund my salary or buy The Erlanger Playbook The Erlanger Playbook https://ninenines.eu/articles/erlanger-playbook/ Thu, 18 Jun 2015 00:00:00 +0100 https://ninenines.eu/articles/erlanger-playbook/ I am proud to announce the pre-release of The Erlanger Playbook. The Erlanger Playbook is a book about software development using Erlang. It currently covers all areas from the conception, design, the writing of code, documentation and tests. The book is still a work in progress. Future topics will include refactoring, debugging and tracing, benchmarking, releases, community management (for open source projects). The following sections are currently available: About this book; Changelog; Future additions Erlang: Building blocks; Patterns Workflow: Think; Write; Stay productive Documentation: On documentation; Tutorials; User guide; Manual; README files Design: RESTful APIs; Lessons learned Code: Starting a project; Version control; Project structure; Code style; Best practices; Special processes; IOLists; The process dictionary Tests: On testing; Success typing analysis; Manual testing; Unit testing; Functional testing Selling Erlang: On persuasion; Don't let it crash Read a preview: Special processes Validating UTF-8 binaries with Erlang https://ninenines.eu/articles/erlang-validate-utf8/ Fri, 06 Mar 2015 00:00:00 +0100 https://ninenines.eu/articles/erlang-validate-utf8/ Yesterday I pushed Websocket permessage-deflate to Cowboy master. I also pushed a change in the way the code validates UTF-8 data (required for text and close frames as per the spec). When looking into why the permessage-deflate tests in autobahntestsuite were taking such a long time, I found that autobahn is using an adaptation of the algorithm named Flexible and Economical UTF-8 Decoder. This is the C99 implementation: // Copyright (c) 2008-2009 Bjoern Hoehrmann <bjoern@hoehrmann. On open source https://ninenines.eu/articles/on-open-source/ Fri, 05 Sep 2014 00:00:00 +0100 https://ninenines.eu/articles/on-open-source/ Last week I read a great article on contributing to open source by Alvaro Videla. He makes many great points and I am in agreement with most of it. This made me want to properly explain my point of view with regard to open source and contributions. Unlike most open source evangelism articles I will not talk about ideals or any of that crap, but rather my personal feelings and experience. The story so far https://ninenines.eu/articles/the-story-so-far/ Sat, 23 Aug 2014 00:00:00 +0100 https://ninenines.eu/articles/the-story-so-far/ As I am away from home with little to do (some call this a vacation) I wanted to reflect a little on the story so far, or how I arrived to Erlang and got to where I am now. The raw personal experience. It'll be an article that's more about social aspect, communities and marketing a project than technical considerations. As a period piece, it will also allow me to reflect on the evolution of Erlang in recent years. Cowboy 2.0 and query strings https://ninenines.eu/articles/cowboy2-qs/ Wed, 20 Aug 2014 00:00:00 +0100 https://ninenines.eu/articles/cowboy2-qs/ Now that Cowboy 1.0 is out, I can spend some of my time thinking about Cowboy 2.0 that will be released soon after Erlang/OTP 18.0. This entry discusses the proposed changes to query string handling in Cowboy. Cowboy 2.0 will respond to user wishes by simplifying the interface of the cowboy_req module. Users want two things: less juggling with the Req variable, and more maps. Maps is the only dynamic key/value data structure in Erlang that we can match directly to extract values, allowing users to greatly simplify their code as they don't need to call functions to do everything anymore. January 2014 status https://ninenines.eu/articles/january-2014-status/ Tue, 07 Jan 2014 00:00:00 +0100 https://ninenines.eu/articles/january-2014-status/ I will now be regularly writing posts about project status, plans and hopes for the future. Before that though, there's one important news to share. Until a year ago all development was financed through consulting and development services. This worked alright but too much time was spent doing things that didn't benefit the open source projects. And that didn't make me happy at all. Because I like being happy I stopped that for the most part and spent the year figuring things out, experimenting and discussing with people about it. Farwest got funded! https://ninenines.eu/articles/farwest-funded/ Thu, 27 Jun 2013 00:00:00 +0100 https://ninenines.eu/articles/farwest-funded/ This was a triumph! I'm making a note here: HUGE SUCCESS!! It's hard to overstate my satisfaction. Thanks to everyone who made this possible. If you have backed this fundraiser, and haven't provided your personal details yet, please do so quickly so that your rewards can be sent! I am hoping that we will be able to make good use of all that money. The details of the expenses will be published regularly on the 2013 Fundraiser wiki page, giving you full disclosure as to how your money is used. Build Erlang releases with Erlang.mk and Relx https://ninenines.eu/articles/erlang.mk-and-relx/ Tue, 28 May 2013 00:00:00 +0100 https://ninenines.eu/articles/erlang.mk-and-relx/ Building OTP releases has always been a difficult task. Tools like Reltool or Rebar have made this simpler, but it's no panacea. This article will show you an alternative and hopefully much simpler solution. There is two steps to building a release. First you need to build the various OTP applications you want to include in the release. Once done, you need to create the release itself, by including the Erlang runtime system alongside the applications, a boot script to start the node and all its applications, and some configuration files. Xerl: intermediate module https://ninenines.eu/articles/xerl-0.5-intermediate-module/ Mon, 25 Mar 2013 00:00:00 +0100 https://ninenines.eu/articles/xerl-0.5-intermediate-module/ Today we will start the work on the intermediate module that will be used to run the code for the expressions found in our file's body, replacing our interpreter. This is what we want to have when all the work is done: xerl -> tokens -> AST -> intermediate -> cerl Today we will perform this work only on the atomic integer expression however, so we will not build any module at the end. Xerl: expression separator https://ninenines.eu/articles/xerl-0.4-expression-separator/ Fri, 01 Mar 2013 00:00:00 +0100 https://ninenines.eu/articles/xerl-0.4-expression-separator/ As promised we are adding an expression separator this time. This will be short and easy. In the tokenizer we only need to add a line recognizing the comma as a valid token. , : {token, {',', TokenLine}}. Then we need to change the following lines in the parser: exprs -> expr : ['$1']. exprs -> expr exprs : ['$1' | '$2']. And add a comma between the expressions on the second line: Erlang Scalability https://ninenines.eu/articles/erlang-scalability/ Mon, 18 Feb 2013 00:00:00 +0100 https://ninenines.eu/articles/erlang-scalability/ I would like to share some experience and theories on Erlang scalability. This will be in the form of a series of hints, which may or may not be accompanied with explanations as to why things are this way, or how they improve or reduce the scalability of a system. I will try to do my best to avoid giving falsehoods, even if that means a few things won't be explained. Xerl: atomic expressions https://ninenines.eu/articles/xerl-0.3-atomic-expressions/ Mon, 18 Feb 2013 00:00:00 +0100 https://ninenines.eu/articles/xerl-0.3-atomic-expressions/ We will be adding atomic integer expressions to our language. These look as follow in Erlang: 42. And the result of this expression is of course 42. We will be running this expression at compile time, since we don't have the means to run code at runtime yet. This will of course result in no module being compiled, but that's OK, it will allow us to discuss a few important things we'll have to plan for later on. Xerl: two modules https://ninenines.eu/articles/xerl-0.2-two-modules/ Sun, 03 Feb 2013 00:00:00 +0100 https://ninenines.eu/articles/xerl-0.2-two-modules/ Everything is an expression. This sentence carries profound meaning. We will invoke it many times over the course of these articles. If everything is an expression, then the language shouldn't have any problem with me defining two modules in the same source file. mod first_module begin end mod second_module begin end Likewise, it shouldn't have any problem with me defining a module inside another module. mod out_module begin mod in_module begin end end Of course, in the context of the Erlang VM, these two snippets are equivalent; there is nothing preventing you from calling the in_module module from any other module. Xerl: empty modules https://ninenines.eu/articles/xerl-0.1-empty-modules/ Wed, 30 Jan 2013 00:00:00 +0100 https://ninenines.eu/articles/xerl-0.1-empty-modules/ Let's build a programming language. I call it Xerl: eXtended ERLang. It'll be an occasion for us to learn a few things, especially me. Unlike in Erlang, in this language, everything is an expression. This means that modules and functions are expression, and indeed that you can have more than one module per file. We are just starting, so let's no go ahead of ourselves here. We'll begin with writing the code allowing us to compile an empty module. Build an FTP Server with Ranch in 30 Minutes https://ninenines.eu/articles/ranch-ftp/ Wed, 14 Nov 2012 00:00:00 +0100 https://ninenines.eu/articles/ranch-ftp/ Last week I was speaking at the London Erlang Factory Lite where I presented a live demonstration of building an FTP server using Ranch. As there was no slide, you should use this article as a reference instead. The goal of this article is to showcase how to use Ranch for writing a network protocol implementation, how Ranch gets out of the way to let you write the code that matters, and the common techniques used when writing servers. Erlang Tic Tac Toe https://ninenines.eu/articles/tictactoe/ Wed, 17 Oct 2012 00:00:00 +0100 https://ninenines.eu/articles/tictactoe/ Everyone knows Tic Tac Toe, right? Players choose either to be the Xs or the Os, then place their symbol on a 3x3 board one after another, trying to create a line of 3 of them. Writing an algorithm to check for victory sounds easy, right? It's easily tested, considering there's only 8 possible winning rows (3 horizontal, 3 vertical and 2 diagonal). In Erlang though, you probably wouldn't want an algorithm. Cowboy Function Reference https://ninenines.eu/docs/en/cowboy/2.2/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: Cowboy Function Reference https://ninenines.eu/docs/en/cowboy/2.3/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: Cowboy Function Reference https://ninenines.eu/docs/en/cowboy/2.4/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: Cowboy Function Reference https://ninenines.eu/docs/en/cowboy/2.5/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: Cowboy Function Reference https://ninenines.eu/docs/en/cowboy/2.6/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: Cowboy User Guide https://ninenines.eu/docs/en/cowboy/2.2/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/guide/ Rationale The modern Web Erlang and the Web Introduction Introduction Getting started Flow diagram Configuration Listeners Routing Constraints Handlers Handlers Loop handlers Static files Request and response Request details Reading the request body Sending a response Using cookies Multipart REST REST principles Handling REST requests REST flowcharts Designing a resource handler Websocket The Websocket protocol Websocket handlers Advanced Streams Middlewares Additional information Changes since Cowboy 2. Cowboy User Guide https://ninenines.eu/docs/en/cowboy/2.3/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/guide/ Rationale The modern Web Erlang and the Web Introduction Introduction Getting started Flow diagram Configuration Listeners Routing Constraints Handlers Handlers Loop handlers Static files Request and response Request details Reading the request body Sending a response Using cookies Multipart REST REST principles Handling REST requests REST flowcharts Designing a resource handler Websocket The Websocket protocol Websocket handlers Advanced Streams Middlewares Additional information Migrating from Cowboy 2. Cowboy User Guide https://ninenines.eu/docs/en/cowboy/2.4/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/guide/ Rationale The modern Web Erlang and the Web Introduction Introduction Getting started Flow diagram Configuration Listeners Routing Constraints Handlers Handlers Loop handlers Static files Request and response Request details Reading the request body Sending a response Using cookies Multipart REST REST principles Handling REST requests REST flowcharts Designing a resource handler Websocket The Websocket protocol Websocket handlers Advanced Streams Middlewares Additional information Migrating from Cowboy 2. Cowboy User Guide https://ninenines.eu/docs/en/cowboy/2.5/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/guide/ Rationale The modern Web Erlang and the Web Introduction Introduction Getting started Flow diagram Configuration Listeners Routing Constraints Handlers Handlers Loop handlers Static files Request and response Request details Reading the request body Sending a response Using cookies Multipart REST REST principles Handling REST requests REST flowcharts Designing a resource handler Websocket The Websocket protocol Websocket handlers Advanced Streams Middlewares Additional information Migrating from Cowboy 2. Cowboy User Guide https://ninenines.eu/docs/en/cowboy/2.6/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/guide/ Rationale The modern Web Erlang and the Web Introduction Introduction Getting started Flow diagram Configuration Listeners Routing Constraints Handlers Handlers Loop handlers Static files Request and response Request details Reading the request body Sending a response Using cookies Multipart REST REST principles Handling REST requests REST flowcharts Designing a resource handler Websocket The Websocket protocol Websocket handlers Advanced Streams Middlewares Additional information Changes since Cowboy 2. Gun Function Reference https://ninenines.eu/docs/en/gun/1.0/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/ Name gun - HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP Description Gun is an HTTP client for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Gun aims to provide an easy to use, asynchronous and always-connected client. It maintains a permanent connection to the server and reconnects automatically when necessary. Modules gun(3) - Asynchronous HTTP client Dependencies cowlib(7) - Support library for manipulating Web protocols ssl - Secure communication over sockets All these applications must be started before the gun application. Gun Function Reference https://ninenines.eu/docs/en/gun/1.1/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/ Name gun - HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP Description Gun is an HTTP client for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Gun aims to provide an easy to use, asynchronous and always-connected client. It maintains a permanent connection to the server and reconnects automatically when necessary. Modules gun(3) - Asynchronous HTTP client Dependencies cowlib(7) - Support library for manipulating Web protocols ssl - Secure communication over sockets All these applications must be started before the gun application. Gun Function Reference https://ninenines.eu/docs/en/gun/1.2/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/ Name gun - HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP Description Gun is an HTTP client for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Gun aims to provide an easy to use, asynchronous and always-connected client. It maintains a permanent connection to the server and reconnects automatically when necessary. Modules gun(3) - Asynchronous HTTP client Dependencies cowlib(7) - Support library for manipulating Web protocols ssl - Secure communication over sockets All these applications must be started before the gun application. Gun Function Reference https://ninenines.eu/docs/en/gun/1.3/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/ Name gun - HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP Description Gun is an HTTP client for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Gun aims to provide an easy to use, asynchronous and always-connected client. It maintains a permanent connection to the server and reconnects automatically when necessary. Modules gun(3) - Asynchronous HTTP client Dependencies cowlib(7) - Support library for manipulating Web protocols ssl - Secure communication over sockets All these applications must be started before the gun application. Gun User Guide https://ninenines.eu/docs/en/gun/1.0/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/guide/ Introduction Starting and stopping Supported protocols Connection Using HTTP Using Websocket Gun User Guide https://ninenines.eu/docs/en/gun/1.1/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/guide/ Interface Introduction Starting and stopping Supported protocols Connection Using HTTP Using Websocket Additional information Migrating from Gun 1.0 to 1.1 Gun User Guide https://ninenines.eu/docs/en/gun/1.2/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/guide/ Interface Introduction Starting and stopping Supported protocols Connection Using HTTP Using Websocket Additional information Migrating from Gun 1.1 to 1.2 Migrating from Gun 1.0 to 1.1 Gun User Guide https://ninenines.eu/docs/en/gun/1.3/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/guide/ Interface Introduction Starting and stopping Supported protocols Connection Using HTTP Using Websocket Additional information Migrating from Gun 1.2 to 1.3 Migrating from Gun 1.1 to 1.2 Migrating from Gun 1.0 to 1.1 HTTP status codes(7) https://ninenines.eu/docs/en/cowboy/2.2/manual/http_status_codes/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/http_status_codes/ Name HTTP status codes - status codes used by Cowboy Description This chapter aims to list all HTTP status codes that Cowboy may return, with details on the reasons why. The list given here only includes the replies that Cowboy sends, not user replies. 100 Continue When the client sends an expect: 100-continue header, Cowboy automatically sends a this status code before trying to read the request body. This behavior can be disabled using the appropriate body option. HTTP status codes(7) https://ninenines.eu/docs/en/cowboy/2.3/manual/http_status_codes/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/http_status_codes/ Name HTTP status codes - status codes used by Cowboy Description This chapter aims to list all HTTP status codes that Cowboy may return, with details on the reasons why. The list given here only includes the replies that Cowboy sends, not user replies. 100 Continue When the client sends an expect: 100-continue header, Cowboy automatically sends a this status code before trying to read the request body. This behavior can be disabled using the appropriate body option. HTTP status codes(7) https://ninenines.eu/docs/en/cowboy/2.4/manual/http_status_codes/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/http_status_codes/ Name HTTP status codes - status codes used by Cowboy Description This chapter aims to list all HTTP status codes that Cowboy may return, with details on the reasons why. The list given here only includes the replies that Cowboy sends, not user replies. 100 Continue When the client sends an expect: 100-continue header, Cowboy automatically sends a this status code before trying to read the request body. This behavior can be disabled using the appropriate body option. HTTP status codes(7) https://ninenines.eu/docs/en/cowboy/2.5/manual/http_status_codes/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/http_status_codes/ Name HTTP status codes - status codes used by Cowboy Description This chapter aims to list all HTTP status codes that Cowboy may return, with details on the reasons why. The list given here only includes the replies that Cowboy sends, not user replies. 100 Continue When the client sends an expect: 100-continue header, Cowboy automatically sends a this status code before trying to read the request body. This behavior can be disabled using the appropriate body option. HTTP status codes(7) https://ninenines.eu/docs/en/cowboy/2.6/manual/http_status_codes/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/http_status_codes/ Name HTTP status codes - status codes used by Cowboy Description This chapter aims to list all HTTP status codes that Cowboy may return, with details on the reasons why. The list given here only includes the replies that Cowboy sends, not user replies. 100 Continue When the client sends an expect: 100-continue header, Cowboy automatically sends a this status code before trying to read the request body. This behavior can be disabled using the appropriate body option. Ranch Function Reference https://ninenines.eu/docs/en/ranch/1.4/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/manual/ ranch(7) ranch(3) ranch_protocol(3) ranch_ssl(3) ranch_tcp(3) ranch_transport(3) Ranch Function Reference https://ninenines.eu/docs/en/ranch/1.5/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/manual/ ranch(7) ranch(3) ranch_protocol(3) ranch_ssl(3) ranch_tcp(3) ranch_transport(3) Ranch Function Reference https://ninenines.eu/docs/en/ranch/1.6/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ Name ranch - Socket acceptor pool for TCP protocols Description Ranch is a socket acceptor pool for TCP protocols. Ranch manages listeners which are a set of processes that accept and manage connections. The connection's transport and protocol modules are configured per listener. Listeners can be inspected and reconfigured without interruptions in service. Modules Functions: ranch(3) - Socket acceptor pool Transports: ranch_ssl(3) - SSL transport ranch_tcp(3) - TLS transport Behaviors: Ranch Function Reference https://ninenines.eu/docs/en/ranch/1.7/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ Name ranch - Socket acceptor pool for TCP protocols Description Ranch is a socket acceptor pool for TCP protocols. Ranch manages listeners which are a set of processes that accept and manage connections. The connection's transport and protocol modules are configured per listener. Listeners can be inspected and reconfigured without interruptions in service. Modules Functions: ranch(3) - Socket acceptor pool ranch_proxy_header(3) - PROXY protocol Transports: ranch_ssl(3) - SSL transport ranch_tcp(3) - TCP transport Behaviors: Ranch Function Reference https://ninenines.eu/docs/en/ranch/2.0/manual/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ ranch(7) ranch(3) ranch:child_spec(3) ranch:get_addr(3) ranch:get_max_connections(3) ranch:get_port(3) ranch:get_protocol_options(3) ranch:get_status(3) ranch:get_transport_options(3) ranch:handshake(3) ranch:info(3) ranch:procs(3) ranch_protocol(3) ranch_proxy_header(3) ranch_proxy_header:header(3) ranch_proxy_header:parse(3) ranch:recv_proxy_header(3) ranch:remove_connection(3) ranch:resume_listener(3) ranch:set_max_connections(3) ranch:set_protocol_options(3) ranch:set_transport_options(3) ranch_ssl(3) ranch:start_listener(3) ranch:stop_listener(3) ranch:suspend_listener(3) ranch_tcp(3) ranch_transport(3) ranch_transport:sendfile(3) ranch:wait_for_connections(3) Ranch User Guide https://ninenines.eu/docs/en/ranch/1.4/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/guide/ Introduction Listeners Transports Protocols Embedded mode Writing parsers SSL client authentication Internals Ranch User Guide https://ninenines.eu/docs/en/ranch/1.5/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/guide/ Introduction Listeners Transports Protocols Embedded mode Writing parsers SSL client authentication Internals Ranch User Guide https://ninenines.eu/docs/en/ranch/1.6/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/guide/ Interface Introduction Listeners Transports Protocols Embedded mode How to Writing parsers SSL client authentication Advanced Internals Additional information Upcoming changes in Ranch 2.0 Changes since Ranch 1.6 Migrating from Ranch 1.5 to 1.6 Migrating from Ranch 1.x Ranch User Guide https://ninenines.eu/docs/en/ranch/1.7/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/guide/ Interface Introduction Listeners Transports Protocols Embedded mode How to Writing parsers SSL client authentication Advanced Internals Additional information Upcoming changes in Ranch 2.0 Changes since Ranch 1.7 Migrating from Ranch 1.6 to 1.7 Migrating from Ranch 1.5 to 1.6 Migrating from Ranch 1.x Ranch User Guide https://ninenines.eu/docs/en/ranch/2.0/guide/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/guide/ Interface Introduction Listeners Transports Protocols Embedded mode How to Writing parsers SSL client authentication Connection draining Advanced Internals Additional information Migrating from Ranch 1.7 to 2.0 Migrating from Ranch 1.6 to 1.7 Migrating from Ranch 1.5 to 1.6 Migrating from Ranch 1.x cowboy(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy/ Name cowboy - HTTP server Description The module cowboy provides convenience functions for manipulating Ranch listeners. Exports cowboy:start_clear(3) - Listen for connections using plain TCP cowboy:start_tls(3) - Listen for connections using TLS cowboy:stop_listener(3) - Stop the given listener cowboy:set_env(3) - Update a listener's environment value Types fields() fields() :: [Name | {Name, Constraints} | {Name, Constraints, Default}] Name :: atom() Constraints :: Constraint | [Constraint] Constraint :: cowboy_constraints:constraint() Default :: any() Fields description for match operations. cowboy(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy/ Name cowboy - HTTP server Description The module cowboy provides convenience functions for manipulating Ranch listeners. Exports cowboy:start_clear(3) - Listen for connections using plain TCP cowboy:start_tls(3) - Listen for connections using TLS cowboy:stop_listener(3) - Stop the given listener cowboy:set_env(3) - Update a listener's environment value Types fields() fields() :: [Name | {Name, Constraints} | {Name, Constraints, Default}] Name :: atom() Constraints :: Constraint | [Constraint] Constraint :: cowboy_constraints:constraint() Default :: any() Fields description for match operations. cowboy(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy/ Name cowboy - HTTP server Description The module cowboy provides convenience functions for manipulating Ranch listeners. Exports cowboy:start_clear(3) - Listen for connections using plain TCP cowboy:start_tls(3) - Listen for connections using TLS cowboy:stop_listener(3) - Stop the given listener cowboy:set_env(3) - Update a listener's environment value Types fields() fields() :: [Name | {Name, Constraints} | {Name, Constraints, Default}] Name :: atom() Constraints :: Constraint | [Constraint] Constraint :: cowboy_constraints:constraint() Default :: any() Fields description for match operations. cowboy(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy/ Name cowboy - HTTP server Description The module cowboy provides convenience functions for manipulating Ranch listeners. Exports cowboy:start_clear(3) - Listen for connections using plain TCP cowboy:start_tls(3) - Listen for connections using TLS cowboy:stop_listener(3) - Stop the given listener cowboy:set_env(3) - Update a listener's environment value Types fields() fields() :: [Name | {Name, Constraints} | {Name, Constraints, Default}] Name :: atom() Constraints :: Constraint | [Constraint] Constraint :: cowboy_constraints:constraint() Default :: any() Fields description for match operations. cowboy(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy/ Name cowboy - HTTP server Description The module cowboy provides convenience functions for manipulating Ranch listeners. Exports cowboy:start_clear(3) - Listen for connections using plain TCP cowboy:start_tls(3) - Listen for connections using TLS cowboy:stop_listener(3) - Stop the given listener cowboy:set_env(3) - Update a listener's environment value Types fields() fields() :: [Name | {Name, Constraints} | {Name, Constraints, Default}] Name :: atom() Constraints :: Constraint | [Constraint] Constraint :: cowboy_constraints:constraint() Default :: any() Fields description for match operations. cowboy(7) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_app/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: cowboy(7) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_app/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: cowboy(7) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_app/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: cowboy(7) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_app/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: cowboy(7) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_app/ Name cowboy - Small, fast, modern HTTP server for Erlang/OTP Description Cowboy is an HTTP server for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Cowboy aims to provide a complete HTTP stack. This includes the implementation of the HTTP RFCs but also any directly related standards, like Websocket or Server-Sent Events. Modules Functions: cowboy(3) - Listener management cowboy_req(3) - Request and response cowboy_router(3) - Router cowboy_constraints(3) - Constraints Protocols: cowboy:set_env(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy.set_env/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy.set_env/ Name cowboy:set_env - Update a listener's environment value Description set_env(Name :: ranch:ref(), Key :: atom(), Value :: any()) -> ok Set or update an environment value for a previously started listener. This is most useful for updating the routes dynamically, without having to restart the listener. The new value will only be available to new connections. Pre-existing connections will still use the old value. Arguments Name The name of the listener to update. cowboy:set_env(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy.set_env/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy.set_env/ Name cowboy:set_env - Update a listener's environment value Description set_env(Name :: ranch:ref(), Key :: atom(), Value :: any()) -> ok Set or update an environment value for a previously started listener. This is most useful for updating the routes dynamically, without having to restart the listener. The new value will only be available to new connections. Pre-existing connections will still use the old value. Arguments Name The name of the listener to update. cowboy:set_env(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy.set_env/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy.set_env/ Name cowboy:set_env - Update a listener's environment value Description set_env(Name :: ranch:ref(), Key :: atom(), Value :: any()) -> ok Set or update an environment value for a previously started listener. This is most useful for updating the routes dynamically, without having to restart the listener. The new value will only be available to new connections. Pre-existing connections will still use the old value. Arguments Name The name of the listener to update. cowboy:set_env(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy.set_env/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy.set_env/ Name cowboy:set_env - Update a listener's environment value Description set_env(Name :: ranch:ref(), Key :: atom(), Value :: any()) -> ok Set or update an environment value for a previously started listener. This is most useful for updating the routes dynamically, without having to restart the listener. The new value will only be available to new connections. Pre-existing connections will still use the old value. Arguments Name The name of the listener to update. cowboy:set_env(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy.set_env/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy.set_env/ Name cowboy:set_env - Update a listener's environment value Description set_env(Name :: ranch:ref(), Key :: atom(), Value :: any()) -> ok Set or update an environment value for a previously started listener. This is most useful for updating the routes dynamically, without having to restart the listener. The new value will only be available to new connections. Pre-existing connections will still use the old value. Arguments Name The name of the listener to update. cowboy:start_clear(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy.start_clear/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy.start_clear/ Name cowboy:start_clear - Listen for connections using plain TCP Description start_clear(Name :: ranch:ref(), TransportOpts :: ranch_tcp:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a clear TCP channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. HTTP/2 has two methods of establishing a connection over a clear TCP channel. Both the upgrade and the prior knowledge methods are supported. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_clear(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy.start_clear/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy.start_clear/ Name cowboy:start_clear - Listen for connections using plain TCP Description start_clear(Name :: ranch:ref(), TransportOpts :: ranch_tcp:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a clear TCP channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. HTTP/2 has two methods of establishing a connection over a clear TCP channel. Both the upgrade and the prior knowledge methods are supported. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_clear(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy.start_clear/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy.start_clear/ Name cowboy:start_clear - Listen for connections using plain TCP Description start_clear(Name :: ranch:ref(), TransportOpts :: ranch_tcp:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a clear TCP channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. HTTP/2 has two methods of establishing a connection over a clear TCP channel. Both the upgrade and the prior knowledge methods are supported. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_clear(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy.start_clear/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy.start_clear/ Name cowboy:start_clear - Listen for connections using plain TCP Description start_clear(Name :: ranch:ref(), TransportOpts :: ranch_tcp:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a clear TCP channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. HTTP/2 has two methods of establishing a connection over a clear TCP channel. Both the upgrade and the prior knowledge methods are supported. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_clear(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy.start_clear/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy.start_clear/ Name cowboy:start_clear - Listen for connections using plain TCP Description start_clear(Name :: ranch:ref(), TransportOpts :: ranch_tcp:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a clear TCP channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. HTTP/2 has two methods of establishing a connection over a clear TCP channel. Both the upgrade and the prior knowledge methods are supported. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_tls(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy.start_tls/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy.start_tls/ Name cowboy:start_tls - Listen for connections using TLS Description start_tls(Name :: ranch:ref(), TransportOpts :: ranch_ssl:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a secure TLS channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. The ALPN TLS extension must be used to initiate an HTTP/2 connection. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_tls(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy.start_tls/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy.start_tls/ Name cowboy:start_tls - Listen for connections using TLS Description start_tls(Name :: ranch:ref(), TransportOpts :: ranch_ssl:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a secure TLS channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. The ALPN TLS extension must be used to initiate an HTTP/2 connection. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_tls(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy.start_tls/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy.start_tls/ Name cowboy:start_tls - Listen for connections using TLS Description start_tls(Name :: ranch:ref(), TransportOpts :: ranch_ssl:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a secure TLS channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. The ALPN TLS extension must be used to initiate an HTTP/2 connection. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_tls(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy.start_tls/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy.start_tls/ Name cowboy:start_tls - Listen for connections using TLS Description start_tls(Name :: ranch:ref(), TransportOpts :: ranch_ssl:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a secure TLS channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. The ALPN TLS extension must be used to initiate an HTTP/2 connection. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:start_tls(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy.start_tls/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy.start_tls/ Name cowboy:start_tls - Listen for connections using TLS Description start_tls(Name :: ranch:ref(), TransportOpts :: ranch_ssl:opts(), ProtocolOpts :: opts()) -> {ok, ListenerPid :: pid()} | {error, any()} Start listening for connections over a secure TLS channel. Both HTTP/1.1 and HTTP/2 are supported on this listener. The ALPN TLS extension must be used to initiate an HTTP/2 connection. Arguments Name The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the routes defined. cowboy:stop_listener(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy.stop_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy.stop_listener/ Name cowboy:stop_listener - Stop the given listener Description stop_listener(Name :: ranch:ref()) -> ok | {error, not_found}. Stop a previously started listener. Alias of ranch:stop_listener(3). Arguments Name The name of the listener to be stopped. The name of the listener is the first argument given to the cowboy:start_clear(3), cowboy:start_tls(3) or ranch:start_listener(3) function. Return value The atom ok is returned on success. The {error, not_found} tuple is returned when the listener does not exist. cowboy:stop_listener(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy.stop_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy.stop_listener/ Name cowboy:stop_listener - Stop the given listener Description stop_listener(Name :: ranch:ref()) -> ok | {error, not_found}. Stop a previously started listener. Alias of ranch:stop_listener(3). Arguments Name The name of the listener to be stopped. The name of the listener is the first argument given to the cowboy:start_clear(3), cowboy:start_tls(3) or ranch:start_listener(3) function. Return value The atom ok is returned on success. The {error, not_found} tuple is returned when the listener does not exist. cowboy:stop_listener(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy.stop_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy.stop_listener/ Name cowboy:stop_listener - Stop the given listener Description stop_listener(Name :: ranch:ref()) -> ok | {error, not_found}. Stop a previously started listener. Alias of ranch:stop_listener(3). Arguments Name The name of the listener to be stopped. The name of the listener is the first argument given to the cowboy:start_clear(3), cowboy:start_tls(3) or ranch:start_listener(3) function. Return value The atom ok is returned on success. The {error, not_found} tuple is returned when the listener does not exist. cowboy:stop_listener(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy.stop_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy.stop_listener/ Name cowboy:stop_listener - Stop the given listener Description stop_listener(Name :: ranch:ref()) -> ok | {error, not_found}. Stop a previously started listener. Alias of ranch:stop_listener(3). Arguments Name The name of the listener to be stopped. The name of the listener is the first argument given to the cowboy:start_clear(3), cowboy:start_tls(3) or ranch:start_listener(3) function. Return value The atom ok is returned on success. The {error, not_found} tuple is returned when the listener does not exist. cowboy:stop_listener(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy.stop_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy.stop_listener/ Name cowboy:stop_listener - Stop the given listener Description stop_listener(Name :: ranch:ref()) -> ok | {error, not_found}. Stop a previously started listener. Alias of ranch:stop_listener(3). Arguments Name The name of the listener to be stopped. The name of the listener is the first argument given to the cowboy:start_clear(3), cowboy:start_tls(3) or ranch:start_listener(3) function. Return value The atom ok is returned on success. The {error, not_found} tuple is returned when the listener does not exist. cowboy_compress_h(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_compress_h/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_compress_h/ Name cowboy_compress_h - Compress stream handler Description The module cowboy_compress_h compresses response bodies automatically when the client supports it. It will not try to compress responses that already have a content encoding. Normal responses will only be compressed when their size is lower than the configured threshold. Streamed responses are always compressed, including when the sendfile command is used. Because the file must be read in memory to be compressed, this module is not suitable for automatically compressing large files. cowboy_constraints(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_constraints/ Name cowboy_constraints - Constraints Description The module cowboy_constraints defines the built-in constraints in Cowboy and provides an interface for manipulating these constraints. Constraints are functions that define what type of input is allowed. They are used throughout Cowboy, from the router to query strings to cookies. Exports Built-in constraints: cowboy_constraints:int(3) - Integer constraint cowboy_constraints:nonempty(3) - Non-empty constraint Types constraint() constraint() :: int | nonempty | fun() A constraint function. cowboy_constraints(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_constraints/ Name cowboy_constraints - Constraints Description The module cowboy_constraints defines the built-in constraints in Cowboy and provides an interface for manipulating these constraints. Constraints are functions that define what type of input is allowed. They are used throughout Cowboy, from the router to query strings to cookies. Exports Built-in constraints: cowboy_constraints:int(3) - Integer constraint cowboy_constraints:nonempty(3) - Non-empty constraint Types constraint() constraint() :: int | nonempty | fun() A constraint function. cowboy_constraints(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_constraints/ Name cowboy_constraints - Constraints Description The module cowboy_constraints defines the built-in constraints in Cowboy and provides an interface for manipulating these constraints. Constraints are functions that define what type of input is allowed. They are used throughout Cowboy, from the router to query strings to cookies. Exports Built-in constraints: cowboy_constraints:int(3) - Integer constraint cowboy_constraints:nonempty(3) - Non-empty constraint Types constraint() constraint() :: int | nonempty | fun() A constraint function. cowboy_constraints(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_constraints/ Name cowboy_constraints - Constraints Description The module cowboy_constraints defines the built-in constraints in Cowboy and provides an interface for manipulating these constraints. Constraints are functions that define what type of input is allowed. They are used throughout Cowboy, from the router to query strings to cookies. Exports Built-in constraints: cowboy_constraints:int(3) - Integer constraint cowboy_constraints:nonempty(3) - Non-empty constraint Types constraint() constraint() :: int | nonempty | fun() A constraint function. cowboy_constraints(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_constraints/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_constraints/ Name cowboy_constraints - Constraints Description The module cowboy_constraints defines the built-in constraints in Cowboy and provides an interface for manipulating these constraints. Constraints are functions that define what type of input is allowed. They are used throughout Cowboy, from the router to query strings to cookies. Exports Built-in constraints: cowboy_constraints:int(3) - Integer constraint cowboy_constraints:nonempty(3) - Non-empty constraint Types constraint() constraint() :: int | nonempty | fun() A constraint function. cowboy_constraints:int(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_constraints.int/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_constraints.int/ Name cowboy_constraints:int - Integer constraint Description Constraint functions implement a number of different operations. int(forward, Bin) -> {ok, Int} | {error, not_an_integer} Bin :: binary() Int :: integer() Validate and convert the text representation of an integer. int(reverse, Int) -> {ok, Bin} | {error, not_an_integer} Convert an integer back to its text representation. int(format_error, Error) -> HumanReadable Error :: {not_an_integer, Bin | Int} HumanReadable :: iolist() Generate a human-readable error message. cowboy_constraints:int(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_constraints.int/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_constraints.int/ Name cowboy_constraints:int - Integer constraint Description Constraint functions implement a number of different operations. int(forward, Bin) -> {ok, Int} | {error, not_an_integer} Bin :: binary() Int :: integer() Validate and convert the text representation of an integer. int(reverse, Int) -> {ok, Bin} | {error, not_an_integer} Convert an integer back to its text representation. int(format_error, Error) -> HumanReadable Error :: {not_an_integer, Bin | Int} HumanReadable :: iolist() Generate a human-readable error message. cowboy_constraints:int(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_constraints.int/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_constraints.int/ Name cowboy_constraints:int - Integer constraint Description Constraint functions implement a number of different operations. int(forward, Bin) -> {ok, Int} | {error, not_an_integer} Bin :: binary() Int :: integer() Validate and convert the text representation of an integer. int(reverse, Int) -> {ok, Bin} | {error, not_an_integer} Convert an integer back to its text representation. int(format_error, Error) -> HumanReadable Error :: {not_an_integer, Bin | Int} HumanReadable :: iolist() Generate a human-readable error message. cowboy_constraints:int(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_constraints.int/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_constraints.int/ Name cowboy_constraints:int - Integer constraint Description Constraint functions implement a number of different operations. int(forward, Bin) -> {ok, Int} | {error, not_an_integer} Bin :: binary() Int :: integer() Validate and convert the text representation of an integer. int(reverse, Int) -> {ok, Bin} | {error, not_an_integer} Convert an integer back to its text representation. int(format_error, Error) -> HumanReadable Error :: {not_an_integer, Bin | Int} HumanReadable :: iolist() Generate a human-readable error message. cowboy_constraints:int(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_constraints.int/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_constraints.int/ Name cowboy_constraints:int - Integer constraint Description Constraint functions implement a number of different operations. int(forward, Bin) -> {ok, Int} | {error, not_an_integer} Bin :: binary() Int :: integer() Validate and convert the text representation of an integer. int(reverse, Int) -> {ok, Bin} | {error, not_an_integer} Convert an integer back to its text representation. int(format_error, Error) -> HumanReadable Error :: {not_an_integer, Bin | Int} HumanReadable :: iolist() Generate a human-readable error message. cowboy_constraints:nonempty(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_constraints.nonempty/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_constraints.nonempty/ Name cowboy_constraints:nonempty - Non-empty constraint Description Constraint functions implement a number of different operations. nonempty(forward | reverse, <<>>) -> {error, empty} Reject empty values. nonempty(forward | reverse, Bin) -> {ok, Bin} Bin :: binary() Accept any other binary values. nonempty(format_error, Error) -> HumanReadable Error :: {empty, Bin} HumanReadable :: iolist() Generate a human-readable error message. Arguments Arguments vary depending on the operation. Constraint functions always take the operation type as first argument, and the value as second argument. cowboy_constraints:nonempty(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_constraints.nonempty/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_constraints.nonempty/ Name cowboy_constraints:nonempty - Non-empty constraint Description Constraint functions implement a number of different operations. nonempty(forward | reverse, <<>>) -> {error, empty} Reject empty values. nonempty(forward | reverse, Bin) -> {ok, Bin} Bin :: binary() Accept any other binary values. nonempty(format_error, Error) -> HumanReadable Error :: {empty, Bin} HumanReadable :: iolist() Generate a human-readable error message. Arguments Arguments vary depending on the operation. Constraint functions always take the operation type as first argument, and the value as second argument. cowboy_constraints:nonempty(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_constraints.nonempty/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_constraints.nonempty/ Name cowboy_constraints:nonempty - Non-empty constraint Description Constraint functions implement a number of different operations. nonempty(forward | reverse, <<>>) -> {error, empty} Reject empty values. nonempty(forward | reverse, Bin) -> {ok, Bin} Bin :: binary() Accept any other binary values. nonempty(format_error, Error) -> HumanReadable Error :: {empty, Bin} HumanReadable :: iolist() Generate a human-readable error message. Arguments Arguments vary depending on the operation. Constraint functions always take the operation type as first argument, and the value as second argument. cowboy_constraints:nonempty(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_constraints.nonempty/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_constraints.nonempty/ Name cowboy_constraints:nonempty - Non-empty constraint Description Constraint functions implement a number of different operations. nonempty(forward | reverse, <<>>) -> {error, empty} Reject empty values. nonempty(forward | reverse, Bin) -> {ok, Bin} Bin :: binary() Accept any other binary values. nonempty(format_error, Error) -> HumanReadable Error :: {empty, Bin} HumanReadable :: iolist() Generate a human-readable error message. Arguments Arguments vary depending on the operation. Constraint functions always take the operation type as first argument, and the value as second argument. cowboy_constraints:nonempty(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_constraints.nonempty/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_constraints.nonempty/ Name cowboy_constraints:nonempty - Non-empty constraint Description Constraint functions implement a number of different operations. nonempty(forward | reverse, <<>>) -> {error, empty} Reject empty values. nonempty(forward | reverse, Bin) -> {ok, Bin} Bin :: binary() Accept any other binary values. nonempty(format_error, Error) -> HumanReadable Error :: {empty, Bin} HumanReadable :: iolist() Generate a human-readable error message. Arguments Arguments vary depending on the operation. Constraint functions always take the operation type as first argument, and the value as second argument. cowboy_handler(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_handler/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_handler/ Name cowboy_handler - Plain HTTP handlers Description The cowboy_handler middleware executes the handler selected by the router or any other preceding middleware. This middleware takes the handler module and initial state from the handler and handler_opts environment values, respectively. On completion, it adds a result value to the middleware environment, containing the return value of the terminate/3 callback (if defined) and ok otherwise. This module also defines a callback interface for handling HTTP requests. cowboy_handler(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_handler/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_handler/ Name cowboy_handler - Plain HTTP handlers Description The cowboy_handler middleware executes the handler selected by the router or any other preceding middleware. This middleware takes the handler module and initial state from the handler and handler_opts environment values, respectively. On completion, it adds a result value to the middleware environment, containing the return value of the terminate/3 callback (if defined) and ok otherwise. This module also defines a callback interface for handling HTTP requests. cowboy_handler(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_handler/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_handler/ Name cowboy_handler - Plain HTTP handlers Description The cowboy_handler middleware executes the handler selected by the router or any other preceding middleware. This middleware takes the handler module and initial state from the handler and handler_opts environment values, respectively. On completion, it adds a result value to the middleware environment, containing the return value of the terminate/3 callback (if defined) and ok otherwise. This module also defines a callback interface for handling HTTP requests. cowboy_handler(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_handler/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_handler/ Name cowboy_handler - Plain HTTP handlers Description The cowboy_handler middleware executes the handler selected by the router or any other preceding middleware. This middleware takes the handler module and initial state from the handler and handler_opts environment values, respectively. On completion, it adds a result value to the middleware environment, containing the return value of the terminate/3 callback (if defined) and ok otherwise. This module also defines a callback interface for handling HTTP requests. cowboy_handler(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_handler/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_handler/ Name cowboy_handler - Plain HTTP handlers Description The cowboy_handler middleware executes the handler selected by the router or any other preceding middleware. This middleware takes the handler module and initial state from the handler and handler_opts environment values, respectively. On completion, it adds a result value to the middleware environment, containing the return value of the terminate/3 callback (if defined) and ok otherwise. This module also defines a callback interface for handling HTTP requests. cowboy_handler:terminate(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_handler.terminate/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_handler.terminate/ Name cowboy_handler:terminate - Terminate the handler Description terminate(Reason, PartialReq, State, Handler) -> ok Reason :: any() PartialReq :: map() State :: any() Handler :: module() Call the optional terminate callback if it is defined. Make sure to use this function at the end of the execution of modules that implement custom handler behaviors. Arguments Reason Reason for termination. PartialReq The Req object. It is possible to remove fields from the Req object to save memory when the handler has no concept of requests/responses. cowboy_handler:terminate(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_handler.terminate/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_handler.terminate/ Name cowboy_handler:terminate - Terminate the handler Description terminate(Reason, PartialReq, State, Handler) -> ok Reason :: any() PartialReq :: map() State :: any() Handler :: module() Call the optional terminate callback if it is defined. Make sure to use this function at the end of the execution of modules that implement custom handler behaviors. Arguments Reason Reason for termination. PartialReq The Req object. It is possible to remove fields from the Req object to save memory when the handler has no concept of requests/responses. cowboy_handler:terminate(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_handler.terminate/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_handler.terminate/ Name cowboy_handler:terminate - Terminate the handler Description terminate(Reason, PartialReq, State, Handler) -> ok Reason :: any() PartialReq :: map() State :: any() Handler :: module() Call the optional terminate callback if it is defined. Make sure to use this function at the end of the execution of modules that implement custom handler behaviors. Arguments Reason Reason for termination. PartialReq The Req object. It is possible to remove fields from the Req object to save memory when the handler has no concept of requests/responses. cowboy_handler:terminate(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_handler.terminate/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_handler.terminate/ Name cowboy_handler:terminate - Terminate the handler Description terminate(Reason, PartialReq, State, Handler) -> ok Reason :: any() PartialReq :: map() State :: any() Handler :: module() Call the optional terminate callback if it is defined. Make sure to use this function at the end of the execution of modules that implement custom handler behaviors. Arguments Reason Reason for termination. PartialReq The Req object. It is possible to remove fields from the Req object to save memory when the handler has no concept of requests/responses. cowboy_handler:terminate(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_handler.terminate/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_handler.terminate/ Name cowboy_handler:terminate - Terminate the handler Description terminate(Reason, PartialReq, State, Handler) -> ok Reason :: any() PartialReq :: map() State :: any() Handler :: module() Call the optional terminate callback if it is defined. Make sure to use this function at the end of the execution of modules that implement custom handler behaviors. Arguments Reason Reason for termination. PartialReq The Req object. It is possible to remove fields from the Req object to save memory when the handler has no concept of requests/responses. cowboy_http(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_http/ Name cowboy_http - HTTP/1.1 Description The module cowboy_http implements HTTP/1.1 and HTTP/1.0 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, env => cowboy_middleware:env(), idle_timeout => timeout(), inactivity_timeout => timeout(), max_empty_lines => non_neg_integer(), max_header_name_length => non_neg_integer(), max_header_value_length => non_neg_integer(), max_headers => non_neg_integer(), max_keepalive => non_neg_integer(), max_method_length => non_neg_integer(), max_request_line_length => non_neg_integer(), max_skip_body_length => non_neg_integer(), middlewares => [module()], request_timeout => timeout(), shutdown_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/1. cowboy_http(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_http/ Name cowboy_http - HTTP/1.1 Description The module cowboy_http implements HTTP/1.1 and HTTP/1.0 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, env => cowboy_middleware:env(), idle_timeout => timeout(), inactivity_timeout => timeout(), max_empty_lines => non_neg_integer(), max_header_name_length => non_neg_integer(), max_header_value_length => non_neg_integer(), max_headers => non_neg_integer(), max_keepalive => non_neg_integer(), max_method_length => non_neg_integer(), max_request_line_length => non_neg_integer(), max_skip_body_length => non_neg_integer(), middlewares => [module()], request_timeout => timeout(), shutdown_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/1. cowboy_http(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_http/ Name cowboy_http - HTTP/1.1 Description The module cowboy_http implements HTTP/1.1 and HTTP/1.0 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, env => cowboy_middleware:env(), idle_timeout => timeout(), inactivity_timeout => timeout(), max_empty_lines => non_neg_integer(), max_header_name_length => non_neg_integer(), max_header_value_length => non_neg_integer(), max_headers => non_neg_integer(), max_keepalive => non_neg_integer(), max_method_length => non_neg_integer(), max_request_line_length => non_neg_integer(), max_skip_body_length => non_neg_integer(), middlewares => [module()], request_timeout => timeout(), shutdown_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/1. cowboy_http(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_http/ Name cowboy_http - HTTP/1.1 Description The module cowboy_http implements HTTP/1.1 and HTTP/1.0 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, env => cowboy_middleware:env(), idle_timeout => timeout(), inactivity_timeout => timeout(), linger_timeout => timeout(), max_empty_lines => non_neg_integer(), max_header_name_length => non_neg_integer(), max_header_value_length => non_neg_integer(), max_headers => non_neg_integer(), max_keepalive => non_neg_integer(), max_method_length => non_neg_integer(), max_request_line_length => non_neg_integer(), max_skip_body_length => non_neg_integer(), middlewares => [module()], request_timeout => timeout(), shutdown_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/1. cowboy_http(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_http/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_http/ Name cowboy_http - HTTP/1.1 Description The module cowboy_http implements HTTP/1.1 and HTTP/1.0 as a Ranch protocol. Options opts() :: #{ chunked => boolean(), connection_type => worker | supervisor, http10_keepalive => boolean(), idle_timeout => timeout(), inactivity_timeout => timeout(), linger_timeout => timeout(), max_empty_lines => non_neg_integer(), max_header_name_length => non_neg_integer(), max_header_value_length => non_neg_integer(), max_headers => non_neg_integer(), max_keepalive => non_neg_integer(), max_method_length => non_neg_integer(), max_request_line_length => non_neg_integer(), max_skip_body_length => non_neg_integer(), proxy_header => boolean(), request_timeout => timeout(), sendfile => boolean(), stream_handlers => [module()] } Configuration for the HTTP/1. cowboy_http2(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_http2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_http2/ Name cowboy_http2 - HTTP/2 Description The module cowboy_http2 implements HTTP/2 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, env => cowboy_middleware:env(), inactivity_timeout => timeout(), middlewares => [module()], preface_timeout => timeout(), shutdown_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/2 protocol. This configuration is passed to Cowboy when starting listeners using cowboy:start_clear/3 or cowboy:start_tls/3 functions. It can be updated without restarting listeners using the Ranch functions ranch:get_protocol_options/1 and ranch:set_protocol_options/2. cowboy_http2(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_http2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_http2/ Name cowboy_http2 - HTTP/2 Description The module cowboy_http2 implements HTTP/2 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, env => cowboy_middleware:env(), inactivity_timeout => timeout(), middlewares => [module()], preface_timeout => timeout(), shutdown_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/2 protocol. This configuration is passed to Cowboy when starting listeners using cowboy:start_clear/3 or cowboy:start_tls/3 functions. It can be updated without restarting listeners using the Ranch functions ranch:get_protocol_options/1 and ranch:set_protocol_options/2. cowboy_http2(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_http2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_http2/ Name cowboy_http2 - HTTP/2 Description The module cowboy_http2 implements HTTP/2 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, enable_connect_protocol => boolean(), env => cowboy_middleware:env(), inactivity_timeout => timeout(), initial_connection_window_size => 65535..16#7fffffff, initial_stream_window_size => 0..16#7fffffff, max_concurrent_streams => non_neg_integer() | infinity, max_decode_table_size => non_neg_integer(), max_encode_table_size => non_neg_integer(), max_frame_size_received => 16384..16777215, max_frame_size_sent => 16384..16777215 | infinity, middlewares => [module()], preface_timeout => timeout(), settings_timeout => timeout(), shutdown_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/2 protocol. cowboy_http2(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_http2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_http2/ Name cowboy_http2 - HTTP/2 Description The module cowboy_http2 implements HTTP/2 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, enable_connect_protocol => boolean(), env => cowboy_middleware:env(), inactivity_timeout => timeout(), initial_connection_window_size => 65535..16#7fffffff, initial_stream_window_size => 0..16#7fffffff, max_concurrent_streams => non_neg_integer() | infinity, max_decode_table_size => non_neg_integer(), max_encode_table_size => non_neg_integer(), max_frame_size_received => 16384..16777215, max_frame_size_sent => 16384..16777215 | infinity, middlewares => [module()], preface_timeout => timeout(), settings_timeout => timeout(), shutdown_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/2 protocol. cowboy_http2(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_http2/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_http2/ Name cowboy_http2 - HTTP/2 Description The module cowboy_http2 implements HTTP/2 as a Ranch protocol. Options opts() :: #{ connection_type => worker | supervisor, enable_connect_protocol => boolean(), idle_timeout => timeout(), inactivity_timeout => timeout(), initial_connection_window_size => 65535..16#7fffffff, initial_stream_window_size => 0..16#7fffffff, max_concurrent_streams => non_neg_integer() | infinity, max_decode_table_size => non_neg_integer(), max_encode_table_size => non_neg_integer(), max_frame_size_received => 16384..16777215, max_frame_size_sent => 16384..16777215 | infinity, preface_timeout => timeout(), proxy_header => boolean(), sendfile => boolean(), settings_timeout => timeout(), stream_handlers => [module()] } Configuration for the HTTP/2 protocol. cowboy_loop(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_loop/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_loop/ Name cowboy_loop - Loop handlers Description The module cowboy_loop defines a callback interface for long running HTTP connections. You should switch to this behavior for long polling, server-sent events and similar long-running requests. There are generally two usage patterns: Loop until receiving a specific message, then send a response and stop execution (for example long polling); Or initiate a response in init/2 and stream the body in info/3 as necessary (for example server-sent events). cowboy_loop(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_loop/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_loop/ Name cowboy_loop - Loop handlers Description The module cowboy_loop defines a callback interface for long running HTTP connections. You should switch to this behavior for long polling, server-sent events and similar long-running requests. There are generally two usage patterns: Loop until receiving a specific message, then send a response and stop execution (for example long polling); Or initiate a response in init/2 and stream the body in info/3 as necessary (for example server-sent events). cowboy_loop(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_loop/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_loop/ Name cowboy_loop - Loop handlers Description The module cowboy_loop defines a callback interface for long running HTTP connections. You should switch to this behavior for long polling, server-sent events and similar long-running requests. There are generally two usage patterns: Loop until receiving a specific message, then send a response and stop execution (for example long polling); Or initiate a response in init/2 and stream the body in info/3 as necessary (for example server-sent events). cowboy_loop(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_loop/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_loop/ Name cowboy_loop - Loop handlers Description The module cowboy_loop defines a callback interface for long running HTTP connections. You should switch to this behavior for long polling, server-sent events and similar long-running requests. There are generally two usage patterns: Loop until receiving a specific message, then send a response and stop execution (for example long polling); Or initiate a response in init/2 and stream the body in info/3 as necessary (for example server-sent events). cowboy_loop(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_loop/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_loop/ Name cowboy_loop - Loop handlers Description The module cowboy_loop defines a callback interface for long running HTTP connections. You should switch to this behavior for long polling, server-sent events and similar long-running requests. There are generally two usage patterns: Loop until receiving a specific message, then send a response and stop execution (for example long polling); Or initiate a response in init/2 and stream the body in info/3 as necessary (for example server-sent events). cowboy_middleware(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_middleware/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_middleware/ Name cowboy_middleware - Middlewares Description The module cowboy_middleware defines a callback interface for Cowboy middlewares. Middlewares process the request sequentially in the order they are configured. Callbacks Middlewares implement the following interface: execute(Req, Env) -> {ok, Req, Env} | {suspend, module(), atom(), [any()]} | {stop, Req} Req :: cowboy_req:req() Env :: cowboy_middleware:env() The execute/2 is the only callback that needs to be implemented. It must execute the middleware and return with instructions for Cowboy. cowboy_middleware(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_middleware/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_middleware/ Name cowboy_middleware - Middlewares Description The module cowboy_middleware defines a callback interface for Cowboy middlewares. Middlewares process the request sequentially in the order they are configured. Callbacks Middlewares implement the following interface: execute(Req, Env) -> {ok, Req, Env} | {suspend, module(), atom(), [any()]} | {stop, Req} Req :: cowboy_req:req() Env :: cowboy_middleware:env() The execute/2 is the only callback that needs to be implemented. It must execute the middleware and return with instructions for Cowboy. cowboy_middleware(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_middleware/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_middleware/ Name cowboy_middleware - Middlewares Description The module cowboy_middleware defines a callback interface for Cowboy middlewares. Middlewares process the request sequentially in the order they are configured. Callbacks Middlewares implement the following interface: execute(Req, Env) -> {ok, Req, Env} | {suspend, module(), atom(), [any()]} | {stop, Req} Req :: cowboy_req:req() Env :: cowboy_middleware:env() The execute/2 is the only callback that needs to be implemented. It must execute the middleware and return with instructions for Cowboy. cowboy_middleware(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_middleware/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_middleware/ Name cowboy_middleware - Middlewares Description The module cowboy_middleware defines a callback interface for Cowboy middlewares. Middlewares process the request sequentially in the order they are configured. Callbacks Middlewares implement the following interface: execute(Req, Env) -> {ok, Req, Env} | {suspend, module(), atom(), [any()]} | {stop, Req} Req :: cowboy_req:req() Env :: cowboy_middleware:env() The execute/2 is the only callback that needs to be implemented. It must execute the middleware and return with instructions for Cowboy. cowboy_middleware(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_middleware/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_middleware/ Name cowboy_middleware - Middlewares Description The module cowboy_middleware defines a callback interface for Cowboy middlewares. Middlewares process the request sequentially in the order they are configured. Callbacks Middlewares implement the following interface: execute(Req, Env) -> {ok, Req, Env} | {suspend, module(), atom(), [any()]} | {stop, Req} Req :: cowboy_req:req() Env :: cowboy_middleware:env() The execute/2 is the only callback that needs to be implemented. It must execute the middleware and return with instructions for Cowboy. cowboy_req(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req/ Name cowboy_req - HTTP request and response Description The module cowboy_req provides functions to access, manipulate and respond to requests. There are four types of functions in this module. They can be differentiated by their name and their return type: Type Name pattern Return type access no verb, parse_*, match_* Value question has_* boolean() modification set_* Req action any other verb ok | {Result, Value, Req} Any Req returned must be used in place of the one passed as argument. cowboy_req(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req/ Name cowboy_req - HTTP request and response Description The module cowboy_req provides functions to access, manipulate and respond to requests. There are four types of functions in this module. They can be differentiated by their name and their return type: Type Name pattern Return type access no verb, parse_*, match_* Value question has_* boolean() modification set_* Req action any other verb ok | {Result, Value, Req} Any Req returned must be used in place of the one passed as argument. cowboy_req(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req/ Name cowboy_req - HTTP request and response Description The module cowboy_req provides functions to access, manipulate and respond to requests. There are four types of functions in this module. They can be differentiated by their name and their return type: Type Name pattern Return type access no verb, parse_*, match_* Value question has_* boolean() modification set_* Req action any other verb ok | {Result, Value, Req} Any Req returned must be used in place of the one passed as argument. cowboy_req(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req/ Name cowboy_req - HTTP request and response Description The module cowboy_req provides functions to access, manipulate and respond to requests. There are four types of functions in this module. They can be differentiated by their name and their return type: Type Name pattern Return type access no verb, parse_*, match_* Value question has_* boolean() modification set_* Req action any other verb ok | {Result, Value, Req} Any Req returned must be used in place of the one passed as argument. cowboy_req(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req/ Name cowboy_req - HTTP request and response Description The module cowboy_req provides functions to access, manipulate and respond to requests. There are four types of functions in this module. They can be differentiated by their name and their return type: Type Name pattern Return type access no verb, parse_*, match_* Value question has_* boolean() modification set_* Req action any other verb ok | {Result, Value, Req} Any Req returned must be used in place of the one passed as argument. cowboy_req:binding(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.binding/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.binding/ Name cowboy_req:binding - Access a value bound from the route Description binding(Name, Req) -> binding(Name, Req, undefined) binding(Name, Req, Default) -> any() | Default Name :: atom() Req :: cowboy_req:req() Default :: any() Return the value for the given binding. Arguments Name Desired binding name as an atom. Req The Req object. Default Default value returned when the binding is missing. Return value By default the value is a case sensitive binary string, however constraints may change the type of this value (for example automatically converting numbers to integer). cowboy_req:binding(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.binding/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.binding/ Name cowboy_req:binding - Access a value bound from the route Description binding(Name, Req) -> binding(Name, Req, undefined) binding(Name, Req, Default) -> any() | Default Name :: atom() Req :: cowboy_req:req() Default :: any() Return the value for the given binding. Arguments Name Desired binding name as an atom. Req The Req object. Default Default value returned when the binding is missing. Return value By default the value is a case sensitive binary string, however constraints may change the type of this value (for example automatically converting numbers to integer). cowboy_req:binding(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.binding/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.binding/ Name cowboy_req:binding - Access a value bound from the route Description binding(Name, Req) -> binding(Name, Req, undefined) binding(Name, Req, Default) -> any() | Default Name :: atom() Req :: cowboy_req:req() Default :: any() Return the value for the given binding. Arguments Name Desired binding name as an atom. Req The Req object. Default Default value returned when the binding is missing. Return value By default the value is a case sensitive binary string, however constraints may change the type of this value (for example automatically converting numbers to integer). cowboy_req:binding(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.binding/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.binding/ Name cowboy_req:binding - Access a value bound from the route Description binding(Name, Req) -> binding(Name, Req, undefined) binding(Name, Req, Default) -> any() | Default Name :: atom() Req :: cowboy_req:req() Default :: any() Return the value for the given binding. Arguments Name Desired binding name as an atom. Req The Req object. Default Default value returned when the binding is missing. Return value By default the value is a case sensitive binary string, however constraints may change the type of this value (for example automatically converting numbers to integer). cowboy_req:binding(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.binding/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.binding/ Name cowboy_req:binding - Access a value bound from the route Description binding(Name, Req) -> binding(Name, Req, undefined) binding(Name, Req, Default) -> any() | Default Name :: atom() Req :: cowboy_req:req() Default :: any() Return the value for the given binding. Arguments Name Desired binding name as an atom. Req The Req object. Default Default value returned when the binding is missing. Return value By default the value is a case sensitive binary string, however constraints may change the type of this value (for example automatically converting numbers to integer). cowboy_req:bindings(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.bindings/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.bindings/ Name cowboy_req:bindings - Access all values bound from the route Description bindings(Req :: cowboy_req:req()) -> cowboy_router:bindings() Return a map containing all bindings. Arguments Req The Req object. Return value By default values are case sensitive binary strings, however constraints may change the type of this value (for example automatically converting numbers to integer). Changelog 2.0: Only the values are returned, they are no longer wrapped in a tuple. cowboy_req:bindings(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.bindings/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.bindings/ Name cowboy_req:bindings - Access all values bound from the route Description bindings(Req :: cowboy_req:req()) -> cowboy_router:bindings() Return a map containing all bindings. Arguments Req The Req object. Return value By default values are case sensitive binary strings, however constraints may change the type of this value (for example automatically converting numbers to integer). Changelog 2.0: Only the values are returned, they are no longer wrapped in a tuple. cowboy_req:bindings(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.bindings/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.bindings/ Name cowboy_req:bindings - Access all values bound from the route Description bindings(Req :: cowboy_req:req()) -> cowboy_router:bindings() Return a map containing all bindings. Arguments Req The Req object. Return value By default values are case sensitive binary strings, however constraints may change the type of this value (for example automatically converting numbers to integer). Changelog 2.0: Only the values are returned, they are no longer wrapped in a tuple. cowboy_req:bindings(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.bindings/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.bindings/ Name cowboy_req:bindings - Access all values bound from the route Description bindings(Req :: cowboy_req:req()) -> cowboy_router:bindings() Return a map containing all bindings. Arguments Req The Req object. Return value By default values are case sensitive binary strings, however constraints may change the type of this value (for example automatically converting numbers to integer). Changelog 2.0: Only the values are returned, they are no longer wrapped in a tuple. cowboy_req:bindings(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.bindings/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.bindings/ Name cowboy_req:bindings - Access all values bound from the route Description bindings(Req :: cowboy_req:req()) -> cowboy_router:bindings() Return a map containing all bindings. Arguments Req The Req object. Return value By default values are case sensitive binary strings, however constraints may change the type of this value (for example automatically converting numbers to integer). Changelog 2.0: Only the values are returned, they are no longer wrapped in a tuple. cowboy_req:body_length(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.body_length/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.body_length/ Name cowboy_req:body_length - Body length Description body_length(Req :: cowboy_req:req()) -> undefined | non_neg_integer() Return the length of the request body. The length is not always known before reading the body. In those cases Cowboy will return undefined. The body length is available after the body has been fully read. Arguments Req The Req object. Return value The length of the request body, or undefined if it is not known. cowboy_req:body_length(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.body_length/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.body_length/ Name cowboy_req:body_length - Body length Description body_length(Req :: cowboy_req:req()) -> undefined | non_neg_integer() Return the length of the request body. The length is not always known before reading the body. In those cases Cowboy will return undefined. The body length is available after the body has been fully read. Arguments Req The Req object. Return value The length of the request body, or undefined if it is not known. cowboy_req:body_length(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.body_length/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.body_length/ Name cowboy_req:body_length - Body length Description body_length(Req :: cowboy_req:req()) -> undefined | non_neg_integer() Return the length of the request body. The length is not always known before reading the body. In those cases Cowboy will return undefined. The body length is available after the body has been fully read. Arguments Req The Req object. Return value The length of the request body, or undefined if it is not known. cowboy_req:body_length(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.body_length/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.body_length/ Name cowboy_req:body_length - Body length Description body_length(Req :: cowboy_req:req()) -> undefined | non_neg_integer() Return the length of the request body. The length is not always known before reading the body. In those cases Cowboy will return undefined. The body length is available after the body has been fully read. Arguments Req The Req object. Return value The length of the request body, or undefined if it is not known. cowboy_req:body_length(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.body_length/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.body_length/ Name cowboy_req:body_length - Body length Description body_length(Req :: cowboy_req:req()) -> undefined | non_neg_integer() Return the length of the request body. The length is not always known before reading the body. In those cases Cowboy will return undefined. The body length is available after the body has been fully read. Arguments Req The Req object. Return value The length of the request body, or undefined if it is not known. cowboy_req:cert(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.cert/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.cert/ Name cowboy_req:cert - Client TLS certificate Description cert(Req :: cowboy_req:req()) -> binary() | undefined Return the peer's TLS certificate. Using the default configuration this function will always return undefined. You need to explicitly configure Cowboy to request the client certificate. To do this you need to set the verify transport option to verify_peer: {ok, _} = cowboy:start_tls(example, [ {port, 8443}, {cert, "path/to/cert.pem"}, {verify, verify_peer} ], #{ env => #{dispatch => Dispatch} }). cowboy_req:cert(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.cert/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.cert/ Name cowboy_req:cert - Client TLS certificate Description cert(Req :: cowboy_req:req()) -> binary() | undefined Return the peer's TLS certificate. Using the default configuration this function will always return undefined. You need to explicitly configure Cowboy to request the client certificate. To do this you need to set the verify transport option to verify_peer: {ok, _} = cowboy:start_tls(example, [ {port, 8443}, {cert, "path/to/cert.pem"}, {verify, verify_peer} ], #{ env => #{dispatch => Dispatch} }). cowboy_req:cert(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.cert/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.cert/ Name cowboy_req:cert - Client TLS certificate Description cert(Req :: cowboy_req:req()) -> binary() | undefined Return the peer's TLS certificate. Using the default configuration this function will always return undefined. You need to explicitly configure Cowboy to request the client certificate. To do this you need to set the verify transport option to verify_peer: {ok, _} = cowboy:start_tls(example, [ {port, 8443}, {cert, "path/to/cert.pem"}, {verify, verify_peer} ], #{ env => #{dispatch => Dispatch} }). cowboy_req:cert(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.cert/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.cert/ Name cowboy_req:cert - Client TLS certificate Description cert(Req :: cowboy_req:req()) -> binary() | undefined Return the peer's TLS certificate. Using the default configuration this function will always return undefined. You need to explicitly configure Cowboy to request the client certificate. To do this you need to set the verify transport option to verify_peer: {ok, _} = cowboy:start_tls(example, [ {port, 8443}, {cert, "path/to/cert.pem"}, {verify, verify_peer} ], #{ env => #{dispatch => Dispatch} }). cowboy_req:cert(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.cert/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.cert/ Name cowboy_req:cert - Client TLS certificate Description cert(Req :: cowboy_req:req()) -> binary() | undefined Return the peer's TLS certificate. Using the default configuration this function will always return undefined. You need to explicitly configure Cowboy to request the client certificate. To do this you need to set the verify transport option to verify_peer: {ok, _} = cowboy:start_tls(example, [ {port, 8443}, {certfile, "path/to/cert.pem"}, {verify, verify_peer} ], #{ env => #{dispatch => Dispatch} }). cowboy_req:delete_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.delete_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.delete_resp_header/ Name cowboy_req:delete_resp_header - Delete a response header Description delete_resp_header(Name, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Delete the given response header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. Req The Req object. Return value A new Req object is returned. cowboy_req:delete_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.delete_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.delete_resp_header/ Name cowboy_req:delete_resp_header - Delete a response header Description delete_resp_header(Name, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Delete the given response header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. Req The Req object. Return value A new Req object is returned. cowboy_req:delete_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.delete_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.delete_resp_header/ Name cowboy_req:delete_resp_header - Delete a response header Description delete_resp_header(Name, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Delete the given response header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. Req The Req object. Return value A new Req object is returned. cowboy_req:delete_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.delete_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.delete_resp_header/ Name cowboy_req:delete_resp_header - Delete a response header Description delete_resp_header(Name, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Delete the given response header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. Req The Req object. Return value A new Req object is returned. cowboy_req:delete_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.delete_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.delete_resp_header/ Name cowboy_req:delete_resp_header - Delete a response header Description delete_resp_header(Name, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Delete the given response header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. Req The Req object. Return value A new Req object is returned. cowboy_req:has_body(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.has_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.has_body/ Name cowboy_req:has_body - Is there a request body? Description has_body(Req :: cowboy_req:req()) -> boolean() Return whether the request has a body. Arguments Req The Req object. Return value A boolean indicating whether the request has a body. Changelog 1.0: Function introduced. Examples Ensure the request has a body true = cowboy_req:has_body(Req). See also cowboy_req(3), cowboy_req:body_length(3), cowboy_req:read_body(3), cowboy_req:read_urlencoded_body(3), cowboy_req:read_part(3), cowboy_req:read_part_body(3) cowboy_req:has_body(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.has_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.has_body/ Name cowboy_req:has_body - Is there a request body? Description has_body(Req :: cowboy_req:req()) -> boolean() Return whether the request has a body. Arguments Req The Req object. Return value A boolean indicating whether the request has a body. Changelog 1.0: Function introduced. Examples Ensure the request has a body true = cowboy_req:has_body(Req). See also cowboy_req(3), cowboy_req:body_length(3), cowboy_req:read_body(3), cowboy_req:read_urlencoded_body(3), cowboy_req:read_part(3), cowboy_req:read_part_body(3) cowboy_req:has_body(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.has_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.has_body/ Name cowboy_req:has_body - Is there a request body? Description has_body(Req :: cowboy_req:req()) -> boolean() Return whether the request has a body. Arguments Req The Req object. Return value A boolean indicating whether the request has a body. Changelog 1.0: Function introduced. Examples Ensure the request has a body true = cowboy_req:has_body(Req). See also cowboy_req(3), cowboy_req:body_length(3), cowboy_req:read_body(3), cowboy_req:read_urlencoded_body(3), cowboy_req:read_part(3), cowboy_req:read_part_body(3) cowboy_req:has_body(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.has_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.has_body/ Name cowboy_req:has_body - Is there a request body? Description has_body(Req :: cowboy_req:req()) -> boolean() Return whether the request has a body. Arguments Req The Req object. Return value A boolean indicating whether the request has a body. Changelog 1.0: Function introduced. Examples Ensure the request has a body true = cowboy_req:has_body(Req). See also cowboy_req(3), cowboy_req:body_length(3), cowboy_req:read_body(3), cowboy_req:read_urlencoded_body(3), cowboy_req:read_part(3), cowboy_req:read_part_body(3) cowboy_req:has_body(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.has_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.has_body/ Name cowboy_req:has_body - Is there a request body? Description has_body(Req :: cowboy_req:req()) -> boolean() Return whether the request has a body. Arguments Req The Req object. Return value A boolean indicating whether the request has a body. Changelog 1.0: Function introduced. Examples Ensure the request has a body true = cowboy_req:has_body(Req). See also cowboy_req(3), cowboy_req:body_length(3), cowboy_req:read_body(3), cowboy_req:read_urlencoded_body(3), cowboy_req:read_part(3), cowboy_req:read_part_body(3) cowboy_req:has_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.has_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.has_resp_body/ Name cowboy_req:has_resp_body - Is there a response body? Description has_resp_body(Req :: cowboy_req:req()) -> boolean() Return whether a response body has been set. Arguments Req The Req object. Return value A boolean indicating whether a response body has been set. This function will return false when an empty response body has been set. Changelog 1.0: Function introduced. Examples Check whether a body has been set false = cowboy_req:has_resp_body(Req0), Req1 = cowboy_req:set_resp_body(<<" cowboy_req:has_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.has_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.has_resp_body/ Name cowboy_req:has_resp_body - Is there a response body? Description has_resp_body(Req :: cowboy_req:req()) -> boolean() Return whether a response body has been set. Arguments Req The Req object. Return value A boolean indicating whether a response body has been set. This function will return false when an empty response body has been set. Changelog 1.0: Function introduced. Examples Check whether a body has been set false = cowboy_req:has_resp_body(Req0), Req1 = cowboy_req:set_resp_body(<<" cowboy_req:has_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.has_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.has_resp_body/ Name cowboy_req:has_resp_body - Is there a response body? Description has_resp_body(Req :: cowboy_req:req()) -> boolean() Return whether a response body has been set. Arguments Req The Req object. Return value A boolean indicating whether a response body has been set. This function will return false when an empty response body has been set. Changelog 1.0: Function introduced. Examples Check whether a body has been set false = cowboy_req:has_resp_body(Req0), Req1 = cowboy_req:set_resp_body(<<" cowboy_req:has_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.has_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.has_resp_body/ Name cowboy_req:has_resp_body - Is there a response body? Description has_resp_body(Req :: cowboy_req:req()) -> boolean() Return whether a response body has been set. Arguments Req The Req object. Return value A boolean indicating whether a response body has been set. This function will return false when an empty response body has been set. Changelog 1.0: Function introduced. Examples Check whether a body has been set false = cowboy_req:has_resp_body(Req0), Req1 = cowboy_req:set_resp_body(<<" cowboy_req:has_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.has_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.has_resp_body/ Name cowboy_req:has_resp_body - Is there a response body? Description has_resp_body(Req :: cowboy_req:req()) -> boolean() Return whether a response body has been set. Arguments Req The Req object. Return value A boolean indicating whether a response body has been set. This function will return false when an empty response body has been set. Changelog 1.0: Function introduced. Examples Check whether a body has been set false = cowboy_req:has_resp_body(Req0), Req1 = cowboy_req:set_resp_body(<<" cowboy_req:has_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.has_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.has_resp_header/ Name cowboy_req:has_resp_header - Is the given response header set? Description has_resp_header(Name, Req :: cowboy_req:req()) -> boolean() Name :: binary() %% lowercase; case insensitive Return whether the given response header has been set. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. cowboy_req:has_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.has_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.has_resp_header/ Name cowboy_req:has_resp_header - Is the given response header set? Description has_resp_header(Name, Req :: cowboy_req:req()) -> boolean() Name :: binary() %% lowercase; case insensitive Return whether the given response header has been set. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. cowboy_req:has_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.has_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.has_resp_header/ Name cowboy_req:has_resp_header - Is the given response header set? Description has_resp_header(Name, Req :: cowboy_req:req()) -> boolean() Name :: binary() %% lowercase; case insensitive Return whether the given response header has been set. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. cowboy_req:has_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.has_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.has_resp_header/ Name cowboy_req:has_resp_header - Is the given response header set? Description has_resp_header(Name, Req :: cowboy_req:req()) -> boolean() Name :: binary() %% lowercase; case insensitive Return whether the given response header has been set. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. cowboy_req:has_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.has_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.has_resp_header/ Name cowboy_req:has_resp_header - Is the given response header set? Description has_resp_header(Name, Req :: cowboy_req:req()) -> boolean() Name :: binary() %% lowercase; case insensitive Return whether the given response header has been set. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Arguments Name Header name as a lowercase binary string. cowboy_req:header(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.header/ Name cowboy_req:header - HTTP header Description header(Name, Req) -> header(Name, Req, undefined) header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Headers can also be obtained using pattern matching: cowboy_req:header(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.header/ Name cowboy_req:header - HTTP header Description header(Name, Req) -> header(Name, Req, undefined) header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Headers can also be obtained using pattern matching: cowboy_req:header(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.header/ Name cowboy_req:header - HTTP header Description header(Name, Req) -> header(Name, Req, undefined) header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Headers can also be obtained using pattern matching: cowboy_req:header(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.header/ Name cowboy_req:header - HTTP header Description header(Name, Req) -> header(Name, Req, undefined) header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Headers can also be obtained using pattern matching: cowboy_req:header(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.header/ Name cowboy_req:header - HTTP header Description header(Name, Req) -> header(Name, Req, undefined) header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Headers can also be obtained using pattern matching: cowboy_req:headers(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.headers/ Name cowboy_req:headers - HTTP headers Description headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all request headers. Request headers can also be obtained using pattern matching: #{headers := Headers} = Req. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Only the headers are returned, they are no longer wrapped in a tuple. cowboy_req:headers(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.headers/ Name cowboy_req:headers - HTTP headers Description headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all request headers. Request headers can also be obtained using pattern matching: #{headers := Headers} = Req. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Only the headers are returned, they are no longer wrapped in a tuple. cowboy_req:headers(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.headers/ Name cowboy_req:headers - HTTP headers Description headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all request headers. Request headers can also be obtained using pattern matching: #{headers := Headers} = Req. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Only the headers are returned, they are no longer wrapped in a tuple. cowboy_req:headers(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.headers/ Name cowboy_req:headers - HTTP headers Description headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all request headers. Request headers can also be obtained using pattern matching: #{headers := Headers} = Req. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Only the headers are returned, they are no longer wrapped in a tuple. cowboy_req:headers(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.headers/ Name cowboy_req:headers - HTTP headers Description headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all request headers. Request headers can also be obtained using pattern matching: #{headers := Headers} = Req. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Only the headers are returned, they are no longer wrapped in a tuple. cowboy_req:host(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.host/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.host/ Name cowboy_req:host - URI host name Description host(Req :: cowboy_req:req()) -> Host :: binary() Return the host name of the effective request URI. The host name can also be obtained using pattern matching: #{host := Host} = Req. Arguments Req The Req object. Return value The host name is returned as a lowercase binary string. It is case insensitive. Changelog 2.0: Only the host name is returned, it is no longer wrapped in a tuple. cowboy_req:host(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.host/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.host/ Name cowboy_req:host - URI host name Description host(Req :: cowboy_req:req()) -> Host :: binary() Return the host name of the effective request URI. The host name can also be obtained using pattern matching: #{host := Host} = Req. Arguments Req The Req object. Return value The host name is returned as a lowercase binary string. It is case insensitive. Changelog 2.0: Only the host name is returned, it is no longer wrapped in a tuple. cowboy_req:host(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.host/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.host/ Name cowboy_req:host - URI host name Description host(Req :: cowboy_req:req()) -> Host :: binary() Return the host name of the effective request URI. The host name can also be obtained using pattern matching: #{host := Host} = Req. Arguments Req The Req object. Return value The host name is returned as a lowercase binary string. It is case insensitive. Changelog 2.0: Only the host name is returned, it is no longer wrapped in a tuple. cowboy_req:host(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.host/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.host/ Name cowboy_req:host - URI host name Description host(Req :: cowboy_req:req()) -> Host :: binary() Return the host name of the effective request URI. The host name can also be obtained using pattern matching: #{host := Host} = Req. Arguments Req The Req object. Return value The host name is returned as a lowercase binary string. It is case insensitive. Changelog 2.0: Only the host name is returned, it is no longer wrapped in a tuple. cowboy_req:host(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.host/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.host/ Name cowboy_req:host - URI host name Description host(Req :: cowboy_req:req()) -> Host :: binary() Return the host name of the effective request URI. The host name can also be obtained using pattern matching: #{host := Host} = Req. Arguments Req The Req object. Return value The host name is returned as a lowercase binary string. It is case insensitive. Changelog 2.0: Only the host name is returned, it is no longer wrapped in a tuple. cowboy_req:host_info(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.host_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.host_info/ Name cowboy_req:host_info - Access the route's heading host segments Description host_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the heading host segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case insensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:host_info(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.host_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.host_info/ Name cowboy_req:host_info - Access the route's heading host segments Description host_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the heading host segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case insensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:host_info(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.host_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.host_info/ Name cowboy_req:host_info - Access the route's heading host segments Description host_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the heading host segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case insensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:host_info(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.host_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.host_info/ Name cowboy_req:host_info - Access the route's heading host segments Description host_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the heading host segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case insensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:host_info(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.host_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.host_info/ Name cowboy_req:host_info - Access the route's heading host segments Description host_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the heading host segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case insensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:inform(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.inform/ Name cowboy_req:inform - Send an informational response Description inform(Status, Req :: cowboy_req:req()) -> inform(StatusCode, #{}, Req) inform(Status, Headers, Req :: cowboy_req:req()) -> ok Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send an informational response. Informational responses use a status code between 100 and 199. They cannot include a body. This function will not use any of the previously set headers. All headers to be sent must be given directly. Any number of informational responses can be sent as long as they are sent before the proper response. cowboy_req:inform(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.inform/ Name cowboy_req:inform - Send an informational response Description inform(Status, Req :: cowboy_req:req()) -> inform(StatusCode, #{}, Req) inform(Status, Headers, Req :: cowboy_req:req()) -> ok Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send an informational response. Informational responses use a status code between 100 and 199. They cannot include a body. This function will not use any of the previously set headers. All headers to be sent must be given directly. Any number of informational responses can be sent as long as they are sent before the proper response. cowboy_req:inform(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.inform/ Name cowboy_req:inform - Send an informational response Description inform(Status, Req :: cowboy_req:req()) -> inform(StatusCode, #{}, Req) inform(Status, Headers, Req :: cowboy_req:req()) -> ok Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send an informational response. Informational responses use a status code between 100 and 199. They cannot include a body. This function will not use any of the previously set headers. All headers to be sent must be given directly. Any number of informational responses can be sent as long as they are sent before the proper response. cowboy_req:inform(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.inform/ Name cowboy_req:inform - Send an informational response Description inform(Status, Req :: cowboy_req:req()) -> inform(StatusCode, #{}, Req) inform(Status, Headers, Req :: cowboy_req:req()) -> ok Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send an informational response. Informational responses use a status code between 100 and 199. They cannot include a body. This function will not use any of the previously set headers. All headers to be sent must be given directly. Any number of informational responses can be sent as long as they are sent before the proper response. cowboy_req:inform(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.inform/ Name cowboy_req:inform - Send an informational response Description inform(Status, Req :: cowboy_req:req()) -> inform(StatusCode, #{}, Req) inform(Status, Headers, Req :: cowboy_req:req()) -> ok Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send an informational response. Informational responses use a status code between 100 and 199. They cannot include a body. This function will not use any of the previously set headers. All headers to be sent must be given directly. Any number of informational responses can be sent as long as they are sent before the proper response. cowboy_req:match_cookies(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.match_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.match_cookies/ Name cowboy_req:match_cookies - Match cookies against constraints Description match_cookies(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the cookies and match specific values against constraints. Cowboy will only return the cookie values specified in the fields list, and ignore all others. Fields can be either the name of the cookie requested; the name along with a list of constraints; or the name, a list of constraints and a default value in case the cookie is missing. cowboy_req:match_cookies(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.match_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.match_cookies/ Name cowboy_req:match_cookies - Match cookies against constraints Description match_cookies(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the cookies and match specific values against constraints. Cowboy will only return the cookie values specified in the fields list, and ignore all others. Fields can be either the name of the cookie requested; the name along with a list of constraints; or the name, a list of constraints and a default value in case the cookie is missing. cowboy_req:match_cookies(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.match_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.match_cookies/ Name cowboy_req:match_cookies - Match cookies against constraints Description match_cookies(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the cookies and match specific values against constraints. Cowboy will only return the cookie values specified in the fields list, and ignore all others. Fields can be either the name of the cookie requested; the name along with a list of constraints; or the name, a list of constraints and a default value in case the cookie is missing. cowboy_req:match_cookies(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.match_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.match_cookies/ Name cowboy_req:match_cookies - Match cookies against constraints Description match_cookies(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the cookies and match specific values against constraints. Cowboy will only return the cookie values specified in the fields list, and ignore all others. Fields can be either the name of the cookie requested; the name along with a list of constraints; or the name, a list of constraints and a default value in case the cookie is missing. cowboy_req:match_cookies(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.match_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.match_cookies/ Name cowboy_req:match_cookies - Match cookies against constraints Description match_cookies(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the cookies and match specific values against constraints. Cowboy will only return the cookie values specified in the fields list, and ignore all others. Fields can be either the name of the cookie requested; the name along with a list of constraints; or the name, a list of constraints and a default value in case the cookie is missing. cowboy_req:match_qs(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.match_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.match_qs/ Name cowboy_req:match_qs - Match the query string against constraints Description match_qs(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the query string and match specific values against constraints. Cowboy will only return the query string values specified in the fields list, and ignore all others. Fields can be either the key requested; the key along with a list of constraints; or the key, a list of constraints and a default value in case the key is missing. cowboy_req:match_qs(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.match_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.match_qs/ Name cowboy_req:match_qs - Match the query string against constraints Description match_qs(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the query string and match specific values against constraints. Cowboy will only return the query string values specified in the fields list, and ignore all others. Fields can be either the key requested; the key along with a list of constraints; or the key, a list of constraints and a default value in case the key is missing. cowboy_req:match_qs(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.match_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.match_qs/ Name cowboy_req:match_qs - Match the query string against constraints Description match_qs(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the query string and match specific values against constraints. Cowboy will only return the query string values specified in the fields list, and ignore all others. Fields can be either the key requested; the key along with a list of constraints; or the key, a list of constraints and a default value in case the key is missing. cowboy_req:match_qs(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.match_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.match_qs/ Name cowboy_req:match_qs - Match the query string against constraints Description match_qs(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the query string and match specific values against constraints. Cowboy will only return the query string values specified in the fields list, and ignore all others. Fields can be either the key requested; the key along with a list of constraints; or the key, a list of constraints and a default value in case the key is missing. cowboy_req:match_qs(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.match_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.match_qs/ Name cowboy_req:match_qs - Match the query string against constraints Description match_qs(Fields :: cowboy:fields(), Req :: cowboy_req:req()) -> #{atom() => any()} Parse the query string and match specific values against constraints. Cowboy will only return the query string values specified in the fields list, and ignore all others. Fields can be either the key requested; the key along with a list of constraints; or the key, a list of constraints and a default value in case the key is missing. cowboy_req:method(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.method/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.method/ Name cowboy_req:method - HTTP method Description method(Req :: cowboy_req:req()) -> Method :: binary() Return the request's HTTP method. The method can also be obtained using pattern matching: #{method := Method} = Req. Arguments Req The Req object. Return value The request's HTTP method is returned as a binary string. While methods are case sensitive, standard methods are always uppercase. Changelog 2.0: Only the method is returned, it is no longer wrapped in a tuple. cowboy_req:method(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.method/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.method/ Name cowboy_req:method - HTTP method Description method(Req :: cowboy_req:req()) -> Method :: binary() Return the request's HTTP method. The method can also be obtained using pattern matching: #{method := Method} = Req. Arguments Req The Req object. Return value The request's HTTP method is returned as a binary string. While methods are case sensitive, standard methods are always uppercase. Changelog 2.0: Only the method is returned, it is no longer wrapped in a tuple. cowboy_req:method(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.method/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.method/ Name cowboy_req:method - HTTP method Description method(Req :: cowboy_req:req()) -> Method :: binary() Return the request's HTTP method. The method can also be obtained using pattern matching: #{method := Method} = Req. Arguments Req The Req object. Return value The request's HTTP method is returned as a binary string. While methods are case sensitive, standard methods are always uppercase. Changelog 2.0: Only the method is returned, it is no longer wrapped in a tuple. cowboy_req:method(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.method/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.method/ Name cowboy_req:method - HTTP method Description method(Req :: cowboy_req:req()) -> Method :: binary() Return the request's HTTP method. The method can also be obtained using pattern matching: #{method := Method} = Req. Arguments Req The Req object. Return value The request's HTTP method is returned as a binary string. While methods are case sensitive, standard methods are always uppercase. Changelog 2.0: Only the method is returned, it is no longer wrapped in a tuple. cowboy_req:method(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.method/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.method/ Name cowboy_req:method - HTTP method Description method(Req :: cowboy_req:req()) -> Method :: binary() Return the request's HTTP method. The method can also be obtained using pattern matching: #{method := Method} = Req. Arguments Req The Req object. Return value The request's HTTP method is returned as a binary string. While methods are case sensitive, standard methods are always uppercase. Changelog 2.0: Only the method is returned, it is no longer wrapped in a tuple. cowboy_req:parse_cookies(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.parse_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.parse_cookies/ Name cowboy_req:parse_cookies - Parse cookie headers Description parse_cookies(Req) -> [{Name, Value}] Name :: binary() %% case sensitive Value :: binary() %% case sensitive Parse cookie headers. Alias for cowboy_req:parse_header(<<"cookie">>, Req). When the cookie header is missing, [] is returned. While an empty cookie header is not valid, some clients do send it. Cowboy will in this case also return []. Arguments Req The Req object. Return value The cookies are returned as a list of key/values. cowboy_req:parse_cookies(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.parse_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.parse_cookies/ Name cowboy_req:parse_cookies - Parse cookie headers Description parse_cookies(Req) -> [{Name, Value}] Name :: binary() %% case sensitive Value :: binary() %% case sensitive Parse cookie headers. Alias for cowboy_req:parse_header(<<"cookie">>, Req). When the cookie header is missing, [] is returned. While an empty cookie header is not valid, some clients do send it. Cowboy will in this case also return []. Arguments Req The Req object. Return value The cookies are returned as a list of key/values. cowboy_req:parse_cookies(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.parse_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.parse_cookies/ Name cowboy_req:parse_cookies - Parse cookie headers Description parse_cookies(Req) -> [{Name, Value}] Name :: binary() %% case sensitive Value :: binary() %% case sensitive Parse cookie headers. Alias for cowboy_req:parse_header(<<"cookie">>, Req). When the cookie header is missing, [] is returned. While an empty cookie header is not valid, some clients do send it. Cowboy will in this case also return []. Arguments Req The Req object. Return value The cookies are returned as a list of key/values. cowboy_req:parse_cookies(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.parse_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.parse_cookies/ Name cowboy_req:parse_cookies - Parse cookie headers Description parse_cookies(Req) -> [{Name, Value}] Name :: binary() %% case sensitive Value :: binary() %% case sensitive Parse cookie headers. Alias for cowboy_req:parse_header(<<"cookie">>, Req). When the cookie header is missing, [] is returned. While an empty cookie header is not valid, some clients do send it. Cowboy will in this case also return []. Arguments Req The Req object. Return value The cookies are returned as a list of key/values. cowboy_req:parse_cookies(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.parse_cookies/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.parse_cookies/ Name cowboy_req:parse_cookies - Parse cookie headers Description parse_cookies(Req) -> [{Name, Value}] Name :: binary() %% case sensitive Value :: binary() %% case sensitive Parse cookie headers. Alias for cowboy_req:parse_header(<<"cookie">>, Req). When the cookie header is missing, [] is returned. While an empty cookie header is not valid, some clients do send it. Cowboy will in this case also return []. Arguments Req The Req object. Return value The cookies are returned as a list of key/values. cowboy_req:parse_header(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.parse_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.parse_header/ Name cowboy_req:parse_header - Parse the given HTTP header Description parse_header(Name, Req) -> ParsedValue | Default parse_header(Name, Req, Default) -> ParsedValue | Default Name :: binary() Req :: cowboy_req:req() ParsedValue :: any() Default :: any() Parse the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. The type of the parsed value varies depending on the header. cowboy_req:parse_header(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.parse_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.parse_header/ Name cowboy_req:parse_header - Parse the given HTTP header Description parse_header(Name, Req) -> ParsedValue | Default parse_header(Name, Req, Default) -> ParsedValue | Default Name :: binary() Req :: cowboy_req:req() ParsedValue :: any() Default :: any() Parse the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. The type of the parsed value varies depending on the header. cowboy_req:parse_header(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.parse_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.parse_header/ Name cowboy_req:parse_header - Parse the given HTTP header Description parse_header(Name, Req) -> ParsedValue | Default parse_header(Name, Req, Default) -> ParsedValue | Default Name :: binary() Req :: cowboy_req:req() ParsedValue :: any() Default :: any() Parse the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. The type of the parsed value varies depending on the header. cowboy_req:parse_header(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.parse_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.parse_header/ Name cowboy_req:parse_header - Parse the given HTTP header Description parse_header(Name, Req) -> ParsedValue | Default parse_header(Name, Req, Default) -> ParsedValue | Default Name :: binary() Req :: cowboy_req:req() ParsedValue :: any() Default :: any() Parse the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. The type of the parsed value varies depending on the header. cowboy_req:parse_header(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.parse_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.parse_header/ Name cowboy_req:parse_header - Parse the given HTTP header Description parse_header(Name, Req) -> ParsedValue | Default parse_header(Name, Req, Default) -> ParsedValue | Default Name :: binary() Req :: cowboy_req:req() ParsedValue :: any() Default :: any() Parse the given HTTP header. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. The type of the parsed value varies depending on the header. cowboy_req:parse_qs(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.parse_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.parse_qs/ Name cowboy_req:parse_qs - Parse the query string Description parse_qs(Req :: cowboy_req:req()) -> [{Key :: binary(), Value :: binary() | true}] Parse the query string as a list of key/value pairs. Arguments Req The Req object. Return value The parsed query string is returned as a list of key/value pairs. The key is a binary string. The value is either a binary string, or the atom true. Both key and value are case sensitive. cowboy_req:parse_qs(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.parse_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.parse_qs/ Name cowboy_req:parse_qs - Parse the query string Description parse_qs(Req :: cowboy_req:req()) -> [{Key :: binary(), Value :: binary() | true}] Parse the query string as a list of key/value pairs. Arguments Req The Req object. Return value The parsed query string is returned as a list of key/value pairs. The key is a binary string. The value is either a binary string, or the atom true. Both key and value are case sensitive. cowboy_req:parse_qs(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.parse_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.parse_qs/ Name cowboy_req:parse_qs - Parse the query string Description parse_qs(Req :: cowboy_req:req()) -> [{Key :: binary(), Value :: binary() | true}] Parse the query string as a list of key/value pairs. Arguments Req The Req object. Return value The parsed query string is returned as a list of key/value pairs. The key is a binary string. The value is either a binary string, or the atom true. Both key and value are case sensitive. cowboy_req:parse_qs(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.parse_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.parse_qs/ Name cowboy_req:parse_qs - Parse the query string Description parse_qs(Req :: cowboy_req:req()) -> [{Key :: binary(), Value :: binary() | true}] Parse the query string as a list of key/value pairs. Arguments Req The Req object. Return value The parsed query string is returned as a list of key/value pairs. The key is a binary string. The value is either a binary string, or the atom true. Both key and value are case sensitive. cowboy_req:parse_qs(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.parse_qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.parse_qs/ Name cowboy_req:parse_qs - Parse the query string Description parse_qs(Req :: cowboy_req:req()) -> [{Key :: binary(), Value :: binary() | true}] Parse the query string as a list of key/value pairs. Arguments Req The Req object. Return value The parsed query string is returned as a list of key/value pairs. The key is a binary string. The value is either a binary string, or the atom true. Both key and value are case sensitive. cowboy_req:path(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.path/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.path/ Name cowboy_req:path - URI path Description path(Req :: cowboy_req:req()) -> Path :: binary() Return the path of the effective request URI. The path can also be obtained using pattern matching: #{path := Path} = Req. Arguments Req The Req object. Return value The path is returned as a binary string. It is case sensitive. Changelog 2.0: Only the path is returned, it is no longer wrapped in a tuple. cowboy_req:path(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.path/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.path/ Name cowboy_req:path - URI path Description path(Req :: cowboy_req:req()) -> Path :: binary() Return the path of the effective request URI. The path can also be obtained using pattern matching: #{path := Path} = Req. Arguments Req The Req object. Return value The path is returned as a binary string. It is case sensitive. Changelog 2.0: Only the path is returned, it is no longer wrapped in a tuple. cowboy_req:path(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.path/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.path/ Name cowboy_req:path - URI path Description path(Req :: cowboy_req:req()) -> Path :: binary() Return the path of the effective request URI. The path can also be obtained using pattern matching: #{path := Path} = Req. Arguments Req The Req object. Return value The path is returned as a binary string. It is case sensitive. Changelog 2.0: Only the path is returned, it is no longer wrapped in a tuple. cowboy_req:path(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.path/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.path/ Name cowboy_req:path - URI path Description path(Req :: cowboy_req:req()) -> Path :: binary() Return the path of the effective request URI. The path can also be obtained using pattern matching: #{path := Path} = Req. Arguments Req The Req object. Return value The path is returned as a binary string. It is case sensitive. Changelog 2.0: Only the path is returned, it is no longer wrapped in a tuple. cowboy_req:path(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.path/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.path/ Name cowboy_req:path - URI path Description path(Req :: cowboy_req:req()) -> Path :: binary() Return the path of the effective request URI. The path can also be obtained using pattern matching: #{path := Path} = Req. Arguments Req The Req object. Return value The path is returned as a binary string. It is case sensitive. Changelog 2.0: Only the path is returned, it is no longer wrapped in a tuple. cowboy_req:path_info(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.path_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.path_info/ Name cowboy_req:path_info - Access the route's trailing path segments Description path_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the trailing path segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case sensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:path_info(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.path_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.path_info/ Name cowboy_req:path_info - Access the route's trailing path segments Description path_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the trailing path segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case sensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:path_info(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.path_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.path_info/ Name cowboy_req:path_info - Access the route's trailing path segments Description path_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the trailing path segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case sensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:path_info(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.path_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.path_info/ Name cowboy_req:path_info - Access the route's trailing path segments Description path_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the trailing path segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case sensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:path_info(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.path_info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.path_info/ Name cowboy_req:path_info - Access the route's trailing path segments Description path_info(Req :: cowboy_req:req()) -> cowboy_router:tokens() Return the tokens for the trailing path segments. This is the part of the host name that was matched using the ... notation. Arguments Req The Req object. Return value The tokens are returned as a list of case sensitive binary strings. Changelog 2.0: Only the tokens are returned, they are no longer wrapped in a tuple. cowboy_req:peer(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.peer/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.peer/ Name cowboy_req:peer - Peer address and port Description peer(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the peer's IP address and port number. The peer information can also be obtained using pattern matching: #{peer := {IP, Port}} = Req. Arguments Req The Req object. Return value The peer's IP address and port number. The peer is not necessarily the client's IP address and port. It is the IP address of the endpoint connecting directly to the server, which may be a gateway or a proxy. cowboy_req:peer(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.peer/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.peer/ Name cowboy_req:peer - Peer address and port Description peer(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the peer's IP address and port number. The peer information can also be obtained using pattern matching: #{peer := {IP, Port}} = Req. Arguments Req The Req object. Return value The peer's IP address and port number. The peer is not necessarily the client's IP address and port. It is the IP address of the endpoint connecting directly to the server, which may be a gateway or a proxy. cowboy_req:peer(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.peer/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.peer/ Name cowboy_req:peer - Peer address and port Description peer(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the peer's IP address and port number. The peer information can also be obtained using pattern matching: #{peer := {IP, Port}} = Req. Arguments Req The Req object. Return value The peer's IP address and port number. The peer is not necessarily the client's IP address and port. It is the IP address of the endpoint connecting directly to the server, which may be a gateway or a proxy. cowboy_req:peer(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.peer/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.peer/ Name cowboy_req:peer - Peer address and port Description peer(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the peer's IP address and port number. The peer information can also be obtained using pattern matching: #{peer := {IP, Port}} = Req. Arguments Req The Req object. Return value The peer's IP address and port number. The peer is not necessarily the client's IP address and port. It is the IP address of the endpoint connecting directly to the server, which may be a gateway or a proxy. cowboy_req:peer(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.peer/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.peer/ Name cowboy_req:peer - Peer address and port Description peer(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the peer's IP address and port number. The peer information can also be obtained using pattern matching: #{peer := {IP, Port}} = Req. Arguments Req The Req object. Return value The peer's IP address and port number. The peer is not necessarily the client's IP address and port. It is the IP address of the endpoint connecting directly to the server, which may be a gateway or a proxy. cowboy_req:port(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.port/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.port/ Name cowboy_req:port - URI port number Description port(Req :: cowboy_req:req()) -> Port :: inet:port_number() Return the port number of the effective request URI. Note that the port number returned by this function is obtained by parsing the host header. It may be different from the port the peer used to connect to Cowboy. The port number can also be obtained using pattern matching: #{port := Port} = Req. Arguments Req The Req object. cowboy_req:port(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.port/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.port/ Name cowboy_req:port - URI port number Description port(Req :: cowboy_req:req()) -> Port :: inet:port_number() Return the port number of the effective request URI. Note that the port number returned by this function is obtained by parsing the host header. It may be different from the port the peer used to connect to Cowboy. The port number can also be obtained using pattern matching: #{port := Port} = Req. Arguments Req The Req object. cowboy_req:port(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.port/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.port/ Name cowboy_req:port - URI port number Description port(Req :: cowboy_req:req()) -> Port :: inet:port_number() Return the port number of the effective request URI. Note that the port number returned by this function is obtained by parsing the host header. It may be different from the port the peer used to connect to Cowboy. The port number can also be obtained using pattern matching: #{port := Port} = Req. Arguments Req The Req object. cowboy_req:port(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.port/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.port/ Name cowboy_req:port - URI port number Description port(Req :: cowboy_req:req()) -> Port :: inet:port_number() Return the port number of the effective request URI. Note that the port number returned by this function is obtained by parsing the host header. It may be different from the port the peer used to connect to Cowboy. The port number can also be obtained using pattern matching: #{port := Port} = Req. Arguments Req The Req object. cowboy_req:port(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.port/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.port/ Name cowboy_req:port - URI port number Description port(Req :: cowboy_req:req()) -> Port :: inet:port_number() Return the port number of the effective request URI. Note that the port number returned by this function is obtained by parsing the host header. It may be different from the port the peer used to connect to Cowboy. The port number can also be obtained using pattern matching: #{port := Port} = Req. Arguments Req The Req object. cowboy_req:push(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.push/ Name cowboy_req:push - Push a resource to the client Description push(Path, Headers, Req :: cowboy_req:req()) -> push(Path, Headers, Req, #{}) push(Path, Headers, Req :: cowboy_req:req(), Opts) -> ok Path :: iodata() %% case sensitive Headers :: cowboy:http_headers() Opts :: cowboy_req:push_opts() Push a resource to the client. Cowboy handles push requests the same way as if they came from the client, including the creation of a request handling process, routing and middlewares and so on. cowboy_req:push(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.push/ Name cowboy_req:push - Push a resource to the client Description push(Path, Headers, Req :: cowboy_req:req()) -> push(Path, Headers, Req, #{}) push(Path, Headers, Req :: cowboy_req:req(), Opts) -> ok Path :: iodata() %% case sensitive Headers :: cowboy:http_headers() Opts :: cowboy_req:push_opts() Push a resource to the client. Cowboy handles push requests the same way as if they came from the client, including the creation of a request handling process, routing and middlewares and so on. cowboy_req:push(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.push/ Name cowboy_req:push - Push a resource to the client Description push(Path, Headers, Req :: cowboy_req:req()) -> push(Path, Headers, Req, #{}) push(Path, Headers, Req :: cowboy_req:req(), Opts) -> ok Path :: iodata() %% case sensitive Headers :: cowboy:http_headers() Opts :: cowboy_req:push_opts() Push a resource to the client. Cowboy handles push requests the same way as if they came from the client, including the creation of a request handling process, routing and middlewares and so on. cowboy_req:push(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.push/ Name cowboy_req:push - Push a resource to the client Description push(Path, Headers, Req :: cowboy_req:req()) -> push(Path, Headers, Req, #{}) push(Path, Headers, Req :: cowboy_req:req(), Opts) -> ok Path :: iodata() %% case sensitive Headers :: cowboy:http_headers() Opts :: cowboy_req:push_opts() Push a resource to the client. Cowboy handles push requests the same way as if they came from the client, including the creation of a request handling process, routing and middlewares and so on. cowboy_req:push(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.push/ Name cowboy_req:push - Push a resource to the client Description push(Path, Headers, Req :: cowboy_req:req()) -> push(Path, Headers, Req, #{}) push(Path, Headers, Req :: cowboy_req:req(), Opts) -> ok Path :: iodata() %% case sensitive Headers :: cowboy:http_headers() Opts :: cowboy_req:push_opts() Push a resource to the client. Cowboy handles push requests the same way as if they came from the client, including the creation of a request handling process, routing and middlewares and so on. cowboy_req:qs(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.qs/ Name cowboy_req:qs - URI query string Description qs(Req :: cowboy_req:req()) -> Qs :: binary() Return the query string of the effective request URI. The query string can also be obtained using pattern matching: #{qs := Qs} = Req. Arguments Req The Req object. Return value The query string is returned as a binary string. It is case sensitive. Changelog 2.0: Only the query string is returned, it is no longer wrapped in a tuple. cowboy_req:qs(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.qs/ Name cowboy_req:qs - URI query string Description qs(Req :: cowboy_req:req()) -> Qs :: binary() Return the query string of the effective request URI. The query string can also be obtained using pattern matching: #{qs := Qs} = Req. Arguments Req The Req object. Return value The query string is returned as a binary string. It is case sensitive. Changelog 2.0: Only the query string is returned, it is no longer wrapped in a tuple. cowboy_req:qs(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.qs/ Name cowboy_req:qs - URI query string Description qs(Req :: cowboy_req:req()) -> Qs :: binary() Return the query string of the effective request URI. The query string can also be obtained using pattern matching: #{qs := Qs} = Req. Arguments Req The Req object. Return value The query string is returned as a binary string. It is case sensitive. Changelog 2.0: Only the query string is returned, it is no longer wrapped in a tuple. cowboy_req:qs(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.qs/ Name cowboy_req:qs - URI query string Description qs(Req :: cowboy_req:req()) -> Qs :: binary() Return the query string of the effective request URI. The query string can also be obtained using pattern matching: #{qs := Qs} = Req. Arguments Req The Req object. Return value The query string is returned as a binary string. It is case sensitive. Changelog 2.0: Only the query string is returned, it is no longer wrapped in a tuple. cowboy_req:qs(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.qs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.qs/ Name cowboy_req:qs - URI query string Description qs(Req :: cowboy_req:req()) -> Qs :: binary() Return the query string of the effective request URI. The query string can also be obtained using pattern matching: #{qs := Qs} = Req. Arguments Req The Req object. Return value The query string is returned as a binary string. It is case sensitive. Changelog 2.0: Only the query string is returned, it is no longer wrapped in a tuple. cowboy_req:read_and_match_urlencoded_body(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_and_match_urlencoded_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_and_match_urlencoded_body/ Name cowboy_req:read_and_match_urlencoded_body - Read, parse and match a urlencoded request body against constraints Description read_and_match_urlencoded_body(Fields, Req) -> read_and_match_urlencoded_body(Fields, Req, #{}) read_and_match_urlencoded_body(Fields, Req, Opts) -> {ok, Body, Req} Fields :: cowboy:fields() Req :: cowboy_req:req() Opts :: cowboy_req:read_body_opts() Body :: #{atom() => any()} Read, parse and match a urlencoded request body against constraints. This function reads the request body and parses it as application/x-www-form-urlencoded. It then applies the given field constraints to the urlencoded data and returns the result as a map. cowboy_req:read_and_match_urlencoded_body(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_and_match_urlencoded_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_and_match_urlencoded_body/ Name cowboy_req:read_and_match_urlencoded_body - Read, parse and match a urlencoded request body against constraints Description read_and_match_urlencoded_body(Fields, Req) -> read_and_match_urlencoded_body(Fields, Req, #{}) read_and_match_urlencoded_body(Fields, Req, Opts) -> {ok, Body, Req} Fields :: cowboy:fields() Req :: cowboy_req:req() Opts :: cowboy_req:read_body_opts() Body :: #{atom() => any()} Read, parse and match a urlencoded request body against constraints. This function reads the request body and parses it as application/x-www-form-urlencoded. It then applies the given field constraints to the urlencoded data and returns the result as a map. cowboy_req:read_body(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.read_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.read_body/ Name cowboy_req:read_body - Read the request body Description read_body(Req :: cowboy_req:req()) -> read_body(Req, #{}) read_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the request body. This function reads a chunk of the request body. A more tuple is returned when more data remains to be read. Call the function repeatedly until an ok tuple is returned to read the entire body. cowboy_req:read_body(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.read_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.read_body/ Name cowboy_req:read_body - Read the request body Description read_body(Req :: cowboy_req:req()) -> read_body(Req, #{}) read_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the request body. This function reads a chunk of the request body. A more tuple is returned when more data remains to be read. Call the function repeatedly until an ok tuple is returned to read the entire body. cowboy_req:read_body(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.read_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.read_body/ Name cowboy_req:read_body - Read the request body Description read_body(Req :: cowboy_req:req()) -> read_body(Req, #{}) read_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the request body. This function reads a chunk of the request body. A more tuple is returned when more data remains to be read. Call the function repeatedly until an ok tuple is returned to read the entire body. cowboy_req:read_body(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_body/ Name cowboy_req:read_body - Read the request body Description read_body(Req :: cowboy_req:req()) -> read_body(Req, #{}) read_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the request body. This function reads a chunk of the request body. A more tuple is returned when more data remains to be read. Call the function repeatedly until an ok tuple is returned to read the entire body. cowboy_req:read_body(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_body/ Name cowboy_req:read_body - Read the request body Description read_body(Req :: cowboy_req:req()) -> read_body(Req, #{}) read_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the request body. This function reads a chunk of the request body. A more tuple is returned when more data remains to be read. Call the function repeatedly until an ok tuple is returned to read the entire body. cowboy_req:read_part(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.read_part/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.read_part/ Name cowboy_req:read_part - Read the next multipart headers Description read_part(Req :: cowboy_req:req()) -> read_part(Req, #{}) read_part(Req :: cowboy_req:req(), Opts) -> {ok, Headers, Req} | {done, Req} Opts :: cowboy_req:read_body_opts() Headers :: #{binary() => binary()} Read the next part of a multipart body. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function parses and returns headers. cowboy_req:read_part(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.read_part/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.read_part/ Name cowboy_req:read_part - Read the next multipart headers Description read_part(Req :: cowboy_req:req()) -> read_part(Req, #{}) read_part(Req :: cowboy_req:req(), Opts) -> {ok, Headers, Req} | {done, Req} Opts :: cowboy_req:read_body_opts() Headers :: #{binary() => binary()} Read the next part of a multipart body. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function parses and returns headers. cowboy_req:read_part(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.read_part/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.read_part/ Name cowboy_req:read_part - Read the next multipart headers Description read_part(Req :: cowboy_req:req()) -> read_part(Req, #{}) read_part(Req :: cowboy_req:req(), Opts) -> {ok, Headers, Req} | {done, Req} Opts :: cowboy_req:read_body_opts() Headers :: #{binary() => binary()} Read the next part of a multipart body. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function parses and returns headers. cowboy_req:read_part(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_part/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_part/ Name cowboy_req:read_part - Read the next multipart headers Description read_part(Req :: cowboy_req:req()) -> read_part(Req, #{}) read_part(Req :: cowboy_req:req(), Opts) -> {ok, Headers, Req} | {done, Req} Opts :: cowboy_req:read_body_opts() Headers :: #{binary() => binary()} Read the next part of a multipart body. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function parses and returns headers. cowboy_req:read_part(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_part/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_part/ Name cowboy_req:read_part - Read the next multipart headers Description read_part(Req :: cowboy_req:req()) -> read_part(Req, #{}) read_part(Req :: cowboy_req:req(), Opts) -> {ok, Headers, Req} | {done, Req} Opts :: cowboy_req:read_body_opts() Headers :: #{binary() => binary()} Read the next part of a multipart body. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function parses and returns headers. cowboy_req:read_part_body(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.read_part_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.read_part_body/ Name cowboy_req:read_part_body - Read the current part's body Description read_part_body(Req :: cowboy_req:req()) -> read_part_body(Req, #{}) read_part_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the body of the current part of the multipart message. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function returns the body of the current part. cowboy_req:read_part_body(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.read_part_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.read_part_body/ Name cowboy_req:read_part_body - Read the current part's body Description read_part_body(Req :: cowboy_req:req()) -> read_part_body(Req, #{}) read_part_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the body of the current part of the multipart message. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function returns the body of the current part. cowboy_req:read_part_body(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.read_part_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.read_part_body/ Name cowboy_req:read_part_body - Read the current part's body Description read_part_body(Req :: cowboy_req:req()) -> read_part_body(Req, #{}) read_part_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the body of the current part of the multipart message. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function returns the body of the current part. cowboy_req:read_part_body(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_part_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_part_body/ Name cowboy_req:read_part_body - Read the current part's body Description read_part_body(Req :: cowboy_req:req()) -> read_part_body(Req, #{}) read_part_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the body of the current part of the multipart message. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function returns the body of the current part. cowboy_req:read_part_body(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_part_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_part_body/ Name cowboy_req:read_part_body - Read the current part's body Description read_part_body(Req :: cowboy_req:req()) -> read_part_body(Req, #{}) read_part_body(Req :: cowboy_req:req(), Opts) -> {ok, Data :: binary(), Req} | {more, Data :: binary(), Req} Opts :: cowboy_req:read_body_opts() Read the body of the current part of the multipart message. This function reads the request body and parses it as multipart. Each parts of a multipart representation have their own headers and body. This function returns the body of the current part. cowboy_req:read_urlencoded_body(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.read_urlencoded_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.read_urlencoded_body/ Name cowboy_req:read_urlencoded_body - Read and parse a urlencoded request body Description read_urlencoded_body(Req :: cowboy_req:req()) -> read_urlencoded_body(Req, #{}) read_urlencoded_body(Req :: cowboy_req:req(), Opts) -> {ok, Body, Req} Opts :: cowboy_req:read_body_opts() Body :: [{Key :: binary(), Value :: binary() | true}] Read and parse a urlencoded request body. This function reads the request body and parses it as application/x-www-form-urlencoded. It returns a list of key/values. The urlencoded media type is used by Web browsers when submitting HTML forms using the POST method. cowboy_req:read_urlencoded_body(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.read_urlencoded_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.read_urlencoded_body/ Name cowboy_req:read_urlencoded_body - Read and parse a urlencoded request body Description read_urlencoded_body(Req :: cowboy_req:req()) -> read_urlencoded_body(Req, #{}) read_urlencoded_body(Req :: cowboy_req:req(), Opts) -> {ok, Body, Req} Opts :: cowboy_req:read_body_opts() Body :: [{Key :: binary(), Value :: binary() | true}] Read and parse a urlencoded request body. This function reads the request body and parses it as application/x-www-form-urlencoded. It returns a list of key/values. The urlencoded media type is used by Web browsers when submitting HTML forms using the POST method. cowboy_req:read_urlencoded_body(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.read_urlencoded_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.read_urlencoded_body/ Name cowboy_req:read_urlencoded_body - Read and parse a urlencoded request body Description read_urlencoded_body(Req :: cowboy_req:req()) -> read_urlencoded_body(Req, #{}) read_urlencoded_body(Req :: cowboy_req:req(), Opts) -> {ok, Body, Req} Opts :: cowboy_req:read_body_opts() Body :: [{Key :: binary(), Value :: binary() | true}] Read and parse a urlencoded request body. This function reads the request body and parses it as application/x-www-form-urlencoded. It returns a list of key/values. The urlencoded media type is used by Web browsers when submitting HTML forms using the POST method. cowboy_req:read_urlencoded_body(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_urlencoded_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.read_urlencoded_body/ Name cowboy_req:read_urlencoded_body - Read and parse a urlencoded request body Description read_urlencoded_body(Req :: cowboy_req:req()) -> read_urlencoded_body(Req, #{}) read_urlencoded_body(Req :: cowboy_req:req(), Opts) -> {ok, Body, Req} Opts :: cowboy_req:read_body_opts() Body :: [{Key :: binary(), Value :: binary() | true}] Read and parse a urlencoded request body. This function reads the request body and parses it as application/x-www-form-urlencoded. It returns a list of key/values. The urlencoded media type is used by Web browsers when submitting HTML forms using the POST method. cowboy_req:read_urlencoded_body(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_urlencoded_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.read_urlencoded_body/ Name cowboy_req:read_urlencoded_body - Read and parse a urlencoded request body Description read_urlencoded_body(Req :: cowboy_req:req()) -> read_urlencoded_body(Req, #{}) read_urlencoded_body(Req :: cowboy_req:req(), Opts) -> {ok, Body, Req} Opts :: cowboy_req:read_body_opts() Body :: [{Key :: binary(), Value :: binary() | true}] Read and parse a urlencoded request body. This function reads the request body and parses it as application/x-www-form-urlencoded. It returns a list of key/values. The urlencoded media type is used by Web browsers when submitting HTML forms using the POST method. cowboy_req:reply(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.reply/ Name cowboy_req:reply - Send the response Description reply(Status, Req :: cowboy_req:req()) -> reply(StatusCode, #{}, Req) reply(Status, Headers, Req :: cowboy_req:req()) -> Req reply(Status, Headers, Body, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Body :: cowboy_req:resp_body() Send the response. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:reply(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.reply/ Name cowboy_req:reply - Send the response Description reply(Status, Req :: cowboy_req:req()) -> reply(StatusCode, #{}, Req) reply(Status, Headers, Req :: cowboy_req:req()) -> Req reply(Status, Headers, Body, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Body :: cowboy_req:resp_body() Send the response. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:reply(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.reply/ Name cowboy_req:reply - Send the response Description reply(Status, Req :: cowboy_req:req()) -> reply(StatusCode, #{}, Req) reply(Status, Headers, Req :: cowboy_req:req()) -> Req reply(Status, Headers, Body, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Body :: cowboy_req:resp_body() Send the response. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:reply(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.reply/ Name cowboy_req:reply - Send the response Description reply(Status, Req :: cowboy_req:req()) -> reply(StatusCode, #{}, Req) reply(Status, Headers, Req :: cowboy_req:req()) -> Req reply(Status, Headers, Body, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Body :: cowboy_req:resp_body() Send the response. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:reply(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.reply/ Name cowboy_req:reply - Send the response Description reply(Status, Req :: cowboy_req:req()) -> reply(StatusCode, #{}, Req) reply(Status, Headers, Req :: cowboy_req:req()) -> Req reply(Status, Headers, Body, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Body :: cowboy_req:resp_body() Send the response. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:resp_header(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.resp_header/ Name cowboy_req:resp_header - Response header Description resp_header(Name, Req) -> resp_header(Name, Req, undefined) resp_header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given response header. The response header must have been set previously using cowboy_req:set_resp_header(3) or cowboy_req:set_resp_headers(3). The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:resp_header(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.resp_header/ Name cowboy_req:resp_header - Response header Description resp_header(Name, Req) -> resp_header(Name, Req, undefined) resp_header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given response header. The response header must have been set previously using cowboy_req:set_resp_header(3) or cowboy_req:set_resp_headers(3). The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:resp_header(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.resp_header/ Name cowboy_req:resp_header - Response header Description resp_header(Name, Req) -> resp_header(Name, Req, undefined) resp_header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given response header. The response header must have been set previously using cowboy_req:set_resp_header(3) or cowboy_req:set_resp_headers(3). The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:resp_header(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.resp_header/ Name cowboy_req:resp_header - Response header Description resp_header(Name, Req) -> resp_header(Name, Req, undefined) resp_header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given response header. The response header must have been set previously using cowboy_req:set_resp_header(3) or cowboy_req:set_resp_headers(3). The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:resp_header(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.resp_header/ Name cowboy_req:resp_header - Response header Description resp_header(Name, Req) -> resp_header(Name, Req, undefined) resp_header(Name, Req, Default) -> binary() | Default Name :: binary() %% lowercase; case insensitive Req :: cowboy_req:req() Default :: any() Return the value for the given response header. The response header must have been set previously using cowboy_req:set_resp_header(3) or cowboy_req:set_resp_headers(3). The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. cowboy_req:resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.resp_headers/ Name cowboy_req:resp_headers - Response headers Description resp_headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all response headers. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Function introduced. Examples Get all response headers Headers = cowboy_req:resp_headers(Req). See also cowboy_req(3), cowboy_req:resp_header(3), cowboy_req:set_resp_header(3), cowboy_req:set_resp_headers(3) cowboy_req:resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.resp_headers/ Name cowboy_req:resp_headers - Response headers Description resp_headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all response headers. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Function introduced. Examples Get all response headers Headers = cowboy_req:resp_headers(Req). See also cowboy_req(3), cowboy_req:resp_header(3), cowboy_req:set_resp_header(3), cowboy_req:set_resp_headers(3) cowboy_req:resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.resp_headers/ Name cowboy_req:resp_headers - Response headers Description resp_headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all response headers. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Function introduced. Examples Get all response headers Headers = cowboy_req:resp_headers(Req). See also cowboy_req(3), cowboy_req:resp_header(3), cowboy_req:set_resp_header(3), cowboy_req:set_resp_headers(3) cowboy_req:resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.resp_headers/ Name cowboy_req:resp_headers - Response headers Description resp_headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all response headers. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Function introduced. Examples Get all response headers Headers = cowboy_req:resp_headers(Req). See also cowboy_req(3), cowboy_req:resp_header(3), cowboy_req:set_resp_header(3), cowboy_req:set_resp_headers(3) cowboy_req:resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.resp_headers/ Name cowboy_req:resp_headers - Response headers Description resp_headers(Req :: cowboy_req:req()) -> cowboy:http_headers() Return all response headers. Arguments Req The Req object. Return value Headers are returned as a map with keys being lowercase binary strings, and values as binary strings. Changelog 2.0: Function introduced. Examples Get all response headers Headers = cowboy_req:resp_headers(Req). See also cowboy_req(3), cowboy_req:resp_header(3), cowboy_req:set_resp_header(3), cowboy_req:set_resp_headers(3) cowboy_req:scheme(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.scheme/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.scheme/ Name cowboy_req:scheme - URI scheme Description scheme(Req :: cowboy_req:req()) -> Scheme :: binary() Return the scheme of the effective request URI. The scheme can also be obtained using pattern matching: #{scheme := Scheme} = Req. Arguments Req The Req object. Return value The scheme is returned as a binary. It is case insensitive. Cowboy will only set the scheme to <<"http">> or <<"https">>. Changelog 2.0: Function introduced. cowboy_req:scheme(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.scheme/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.scheme/ Name cowboy_req:scheme - URI scheme Description scheme(Req :: cowboy_req:req()) -> Scheme :: binary() Return the scheme of the effective request URI. The scheme can also be obtained using pattern matching: #{scheme := Scheme} = Req. Arguments Req The Req object. Return value The scheme is returned as a binary. It is case insensitive. Cowboy will only set the scheme to <<"http">> or <<"https">>. Changelog 2.0: Function introduced. cowboy_req:scheme(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.scheme/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.scheme/ Name cowboy_req:scheme - URI scheme Description scheme(Req :: cowboy_req:req()) -> Scheme :: binary() Return the scheme of the effective request URI. The scheme can also be obtained using pattern matching: #{scheme := Scheme} = Req. Arguments Req The Req object. Return value The scheme is returned as a binary. It is case insensitive. Cowboy will only set the scheme to <<"http">> or <<"https">>. Changelog 2.0: Function introduced. cowboy_req:scheme(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.scheme/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.scheme/ Name cowboy_req:scheme - URI scheme Description scheme(Req :: cowboy_req:req()) -> Scheme :: binary() Return the scheme of the effective request URI. The scheme can also be obtained using pattern matching: #{scheme := Scheme} = Req. Arguments Req The Req object. Return value The scheme is returned as a binary. It is case insensitive. Cowboy will only set the scheme to <<"http">> or <<"https">>. Changelog 2.0: Function introduced. cowboy_req:scheme(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.scheme/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.scheme/ Name cowboy_req:scheme - URI scheme Description scheme(Req :: cowboy_req:req()) -> Scheme :: binary() Return the scheme of the effective request URI. The scheme can also be obtained using pattern matching: #{scheme := Scheme} = Req. Arguments Req The Req object. Return value The scheme is returned as a binary. It is case insensitive. Cowboy will only set the scheme to <<"http">> or <<"https">>. Changelog 2.0: Function introduced. cowboy_req:set_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.set_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.set_resp_body/ Name cowboy_req:set_resp_body - Set the response body Description set_resp_body(Body, Req :: cowboy_req:req()) -> Req Body :: cowboy_req:resp_body() Set the response body. The response body will be sent when a reply is initiated. Note that the functions stream_reply/2,3 and reply/4 will override the body set by this function. This function can also be used to remove a response body that was set previously. To do so, simply call this function with an empty body. cowboy_req:set_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.set_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.set_resp_body/ Name cowboy_req:set_resp_body - Set the response body Description set_resp_body(Body, Req :: cowboy_req:req()) -> Req Body :: cowboy_req:resp_body() Set the response body. The response body will be sent when a reply is initiated. Note that the functions stream_reply/2,3 and reply/4 will override the body set by this function. This function can also be used to remove a response body that was set previously. To do so, simply call this function with an empty body. cowboy_req:set_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.set_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.set_resp_body/ Name cowboy_req:set_resp_body - Set the response body Description set_resp_body(Body, Req :: cowboy_req:req()) -> Req Body :: cowboy_req:resp_body() Set the response body. The response body will be sent when a reply is initiated. Note that the functions stream_reply/2,3 and reply/4 will override the body set by this function. This function can also be used to remove a response body that was set previously. To do so, simply call this function with an empty body. cowboy_req:set_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.set_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.set_resp_body/ Name cowboy_req:set_resp_body - Set the response body Description set_resp_body(Body, Req :: cowboy_req:req()) -> Req Body :: cowboy_req:resp_body() Set the response body. The response body will be sent when a reply is initiated. Note that the functions stream_reply/2,3 and reply/4 will override the body set by this function. This function can also be used to remove a response body that was set previously. To do so, simply call this function with an empty body. cowboy_req:set_resp_body(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.set_resp_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.set_resp_body/ Name cowboy_req:set_resp_body - Set the response body Description set_resp_body(Body, Req :: cowboy_req:req()) -> Req Body :: cowboy_req:resp_body() Set the response body. The response body will be sent when a reply is initiated. Note that the functions stream_reply/2,3 and reply/4 will override the body set by this function. This function can also be used to remove a response body that was set previously. To do so, simply call this function with an empty body. cowboy_req:set_resp_cookie(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.set_resp_cookie/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.set_resp_cookie/ Name cowboy_req:set_resp_cookie - Set a cookie Description set_resp_cookie(Name, Value, Req :: cowboy_req:req()) -> set_resp_cookie(Name, Value, [], Req) set_resp_cookie(Name, Value, Req :: cowboy_req:req(), Opts) -> Req Name :: binary() %% case sensitive Value :: iodata() %% case sensitive Opts :: cow_cookie:cookie_opts() Set a cookie to be sent with the response. Note that cookie names are case sensitive. Arguments Name Cookie name. Value Cookie value. Req The Req object. cowboy_req:set_resp_cookie(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.set_resp_cookie/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.set_resp_cookie/ Name cowboy_req:set_resp_cookie - Set a cookie Description set_resp_cookie(Name, Value, Req :: cowboy_req:req()) -> set_resp_cookie(Name, Value, [], Req) set_resp_cookie(Name, Value, Req :: cowboy_req:req(), Opts) -> Req Name :: binary() %% case sensitive Value :: iodata() %% case sensitive Opts :: cow_cookie:cookie_opts() Set a cookie to be sent with the response. Note that cookie names are case sensitive. Arguments Name Cookie name. Value Cookie value. Req The Req object. cowboy_req:set_resp_cookie(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.set_resp_cookie/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.set_resp_cookie/ Name cowboy_req:set_resp_cookie - Set a cookie Description set_resp_cookie(Name, Value, Req :: cowboy_req:req()) -> set_resp_cookie(Name, Value, [], Req) set_resp_cookie(Name, Value, Req :: cowboy_req:req(), Opts) -> Req Name :: binary() %% case sensitive Value :: iodata() %% case sensitive Opts :: cow_cookie:cookie_opts() Set a cookie to be sent with the response. Note that cookie names are case sensitive. Arguments Name Cookie name. Value Cookie value. Req The Req object. cowboy_req:set_resp_cookie(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.set_resp_cookie/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.set_resp_cookie/ Name cowboy_req:set_resp_cookie - Set a cookie Description set_resp_cookie(Name, Value, Req :: cowboy_req:req()) -> set_resp_cookie(Name, Value, [], Req) set_resp_cookie(Name, Value, Req :: cowboy_req:req(), Opts) -> Req Name :: binary() %% case sensitive Value :: iodata() %% case sensitive Opts :: cow_cookie:cookie_opts() Set a cookie to be sent with the response. Note that cookie names are case sensitive. Arguments Name Cookie name. Value Cookie value. Req The Req object. cowboy_req:set_resp_cookie(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.set_resp_cookie/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.set_resp_cookie/ Name cowboy_req:set_resp_cookie - Set a cookie Description set_resp_cookie(Name, Value, Req :: cowboy_req:req()) -> set_resp_cookie(Name, Value, Req, #{}) set_resp_cookie(Name, Value, Req :: cowboy_req:req(), Opts) -> Req Name :: binary() %% case sensitive Value :: iodata() %% case sensitive Opts :: cow_cookie:cookie_opts() Set a cookie to be sent with the response. Note that cookie names are case sensitive. Arguments Name Cookie name. Value Cookie value. Req The Req object. cowboy_req:set_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.set_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.set_resp_header/ Name cowboy_req:set_resp_header - Set a response header Description set_resp_header(Name, Value, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Value :: iodata() %% case depends on header Set a header to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. cowboy_req:set_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.set_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.set_resp_header/ Name cowboy_req:set_resp_header - Set a response header Description set_resp_header(Name, Value, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Value :: iodata() %% case depends on header Set a header to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. cowboy_req:set_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.set_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.set_resp_header/ Name cowboy_req:set_resp_header - Set a response header Description set_resp_header(Name, Value, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Value :: iodata() %% case depends on header Set a header to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. cowboy_req:set_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.set_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.set_resp_header/ Name cowboy_req:set_resp_header - Set a response header Description set_resp_header(Name, Value, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Value :: iodata() %% case depends on header Set a header to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. cowboy_req:set_resp_header(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.set_resp_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.set_resp_header/ Name cowboy_req:set_resp_header - Set a response header Description set_resp_header(Name, Value, Req :: cowboy_req:req()) -> Req Name :: binary() %% lowercase; case insensitive Value :: iodata() %% case depends on header Set a header to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. cowboy_req:set_resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.set_resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.set_resp_headers/ Name cowboy_req:set_resp_headers - Set several response headers Description set_resp_headers(Headers, Req :: cowboy_req:req()) -> Req Headers :: cowboy:http_headers() Set several headers to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may be overwritten by those set from the reply functions. cowboy_req:set_resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.set_resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.set_resp_headers/ Name cowboy_req:set_resp_headers - Set several response headers Description set_resp_headers(Headers, Req :: cowboy_req:req()) -> Req Headers :: cowboy:http_headers() Set several headers to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may be overwritten by those set from the reply functions. cowboy_req:set_resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.set_resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.set_resp_headers/ Name cowboy_req:set_resp_headers - Set several response headers Description set_resp_headers(Headers, Req :: cowboy_req:req()) -> Req Headers :: cowboy:http_headers() Set several headers to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may be overwritten by those set from the reply functions. cowboy_req:set_resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.set_resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.set_resp_headers/ Name cowboy_req:set_resp_headers - Set several response headers Description set_resp_headers(Headers, Req :: cowboy_req:req()) -> Req Headers :: cowboy:http_headers() Set several headers to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may be overwritten by those set from the reply functions. cowboy_req:set_resp_headers(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.set_resp_headers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.set_resp_headers/ Name cowboy_req:set_resp_headers - Set several response headers Description set_resp_headers(Headers, Req :: cowboy_req:req()) -> Req Headers :: cowboy:http_headers() Set several headers to be sent with the response. The header name must be given as a lowercase binary string. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may be overwritten by those set from the reply functions. cowboy_req:sock(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.sock/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.sock/ Name cowboy_req:sock - Socket address and port Description sock(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the socket's IP address and port number. The socket information can also be obtained using pattern matching: #{sock := {IP, Port}} = Req. Arguments Req The Req object. Return value The socket's local IP address and port number. Changelog 2.1: Function introduced. Examples Get the socket's IP address and port number. cowboy_req:sock(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.sock/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.sock/ Name cowboy_req:sock - Socket address and port Description sock(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the socket's IP address and port number. The socket information can also be obtained using pattern matching: #{sock := {IP, Port}} = Req. Arguments Req The Req object. Return value The socket's local IP address and port number. Changelog 2.1: Function introduced. Examples Get the socket's IP address and port number. cowboy_req:sock(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.sock/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.sock/ Name cowboy_req:sock - Socket address and port Description sock(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the socket's IP address and port number. The socket information can also be obtained using pattern matching: #{sock := {IP, Port}} = Req. Arguments Req The Req object. Return value The socket's local IP address and port number. Changelog 2.1: Function introduced. Examples Get the socket's IP address and port number. cowboy_req:sock(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.sock/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.sock/ Name cowboy_req:sock - Socket address and port Description sock(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the socket's IP address and port number. The socket information can also be obtained using pattern matching: #{sock := {IP, Port}} = Req. Arguments Req The Req object. Return value The socket's local IP address and port number. Changelog 2.1: Function introduced. Examples Get the socket's IP address and port number. cowboy_req:sock(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.sock/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.sock/ Name cowboy_req:sock - Socket address and port Description sock(Req :: cowboy_req:req()) -> Info Info :: {inet:ip_address(), inet:port_number()} Return the socket's IP address and port number. The socket information can also be obtained using pattern matching: #{sock := {IP, Port}} = Req. Arguments Req The Req object. Return value The socket's local IP address and port number. Changelog 2.1: Function introduced. Examples Get the socket's IP address and port number. cowboy_req:stream_body(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.stream_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.stream_body/ Name cowboy_req:stream_body - Stream the response body Description stream_body(Data, IsFin, Req :: cowboy_req:req()) -> ok Data :: iodata() IsFin :: fin | nofin Stream the response body. This function may be called as many times as needed after initiating a response using the cowboy_req:stream_reply(3) function. The second argument indicates if this call is the final call. Use the nofin value until you know no more data will be sent. The final call should use fin (possibly with an empty data value) or be a call to the cowboy_req:stream_trailers(3) function. cowboy_req:stream_body(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.stream_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.stream_body/ Name cowboy_req:stream_body - Stream the response body Description stream_body(Data, IsFin, Req :: cowboy_req:req()) -> ok Data :: iodata() IsFin :: fin | nofin Stream the response body. This function may be called as many times as needed after initiating a response using the cowboy_req:stream_reply(3) function. The second argument indicates if this call is the final call. Use the nofin value until you know no more data will be sent. The final call should use fin (possibly with an empty data value) or be a call to the cowboy_req:stream_trailers(3) function. cowboy_req:stream_body(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.stream_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.stream_body/ Name cowboy_req:stream_body - Stream the response body Description stream_body(Data, IsFin, Req :: cowboy_req:req()) -> ok Data :: iodata() IsFin :: fin | nofin Stream the response body. This function may be called as many times as needed after initiating a response using the cowboy_req:stream_reply(3) function. The second argument indicates if this call is the final call. Use the nofin value until you know no more data will be sent. The final call should use fin (possibly with an empty data value) or be a call to the cowboy_req:stream_trailers(3) function. cowboy_req:stream_body(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.stream_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.stream_body/ Name cowboy_req:stream_body - Stream the response body Description stream_body(Data, IsFin, Req :: cowboy_req:req()) -> ok Data :: iodata() IsFin :: fin | nofin Stream the response body. This function may be called as many times as needed after initiating a response using the cowboy_req:stream_reply(3) function. The second argument indicates if this call is the final call. Use the nofin value until you know no more data will be sent. The final call should use fin (possibly with an empty data value) or be a call to the cowboy_req:stream_trailers(3) function. cowboy_req:stream_body(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.stream_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.stream_body/ Name cowboy_req:stream_body - Stream the response body Description stream_body(Data, IsFin, Req :: cowboy_req:req()) -> ok Data :: cowboy_req:resp_body() IsFin :: fin | nofin Stream the response body. This function may be called as many times as needed after initiating a response using the cowboy_req:stream_reply(3) function. The second argument indicates if this call is the final call. Use the nofin value until you know no more data will be sent. The final call should use fin (possibly with an empty data value) or be a call to the cowboy_req:stream_trailers(3) function. cowboy_req:stream_events(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.stream_events/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.stream_events/ Name cowboy_req:stream_events - Stream events Description stream_events(Events, IsFin, Req :: cowboy_req:req()) -> ok Events :: Event | [Event] IsFin :: fin | nofin Event :: #{ comment => iodata(), data => iodata(), event => iodata() | atom(), id => iodata(), retry => non_neg_integer() } Stream events. This function should only be used for text/event-stream responses when using server-sent events. Cowboy will automatically encode the given events to their text representation. cowboy_req:stream_events(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.stream_events/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.stream_events/ Name cowboy_req:stream_events - Stream events Description stream_events(Events, IsFin, Req :: cowboy_req:req()) -> ok Events :: Event | [Event] IsFin :: fin | nofin Event :: #{ comment => iodata(), data => iodata(), event => iodata() | atom(), id => iodata(), retry => non_neg_integer() } Stream events. This function should only be used for text/event-stream responses when using server-sent events. Cowboy will automatically encode the given events to their text representation. cowboy_req:stream_reply(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.stream_reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.stream_reply/ Name cowboy_req:stream_reply - Send the response headers Description stream_reply(Status, Req :: cowboy_req:req()) -> stream_reply(StatusCode, #{}, Req) stream_reply(Status, Headers, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send the response headers. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may overwrite those set by set_resp_header/3. cowboy_req:stream_reply(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.stream_reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.stream_reply/ Name cowboy_req:stream_reply - Send the response headers Description stream_reply(Status, Req :: cowboy_req:req()) -> stream_reply(StatusCode, #{}, Req) stream_reply(Status, Headers, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send the response headers. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may overwrite those set by set_resp_header/3. cowboy_req:stream_reply(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.stream_reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.stream_reply/ Name cowboy_req:stream_reply - Send the response headers Description stream_reply(Status, Req :: cowboy_req:req()) -> stream_reply(StatusCode, #{}, Req) stream_reply(Status, Headers, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send the response headers. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may overwrite those set by set_resp_header/3. cowboy_req:stream_reply(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.stream_reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.stream_reply/ Name cowboy_req:stream_reply - Send the response headers Description stream_reply(Status, Req :: cowboy_req:req()) -> stream_reply(StatusCode, #{}, Req) stream_reply(Status, Headers, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send the response headers. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may overwrite those set by set_resp_header/3. cowboy_req:stream_reply(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.stream_reply/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.stream_reply/ Name cowboy_req:stream_reply - Send the response headers Description stream_reply(Status, Req :: cowboy_req:req()) -> stream_reply(StatusCode, #{}, Req) stream_reply(Status, Headers, Req :: cowboy_req:req()) -> Req Status :: cowboy:http_status() Headers :: cowboy:http_headers() Send the response headers. The header names must be given as lowercase binary strings. While header names are case insensitive, Cowboy requires them to be given as lowercase to function properly. Cowboy does not allow duplicate header names. Headers set by this function may overwrite those set by set_resp_header/3. cowboy_req:stream_trailers(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.stream_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.stream_trailers/ Name cowboy_req:stream_trailers - Send the response trailers Description stream_trailers(Trailers, Req :: cowboy_req:req()) -> ok Trailers :: cowboy:http_headers() Send the response trailers and terminate the stream. This function can only be called once, after initiating a response using cowboy_req:stream_reply(3) and sending zero or more body chunks using cowboy_req:stream_body(3) with the nofin argument set. The function stream_trailers/2 implies fin and automatically terminate the response. You must list all field names sent in trailers in the trailer header, otherwise they might be dropped by intermediaries or clients. cowboy_req:stream_trailers(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.stream_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.stream_trailers/ Name cowboy_req:stream_trailers - Send the response trailers Description stream_trailers(Trailers, Req :: cowboy_req:req()) -> ok Trailers :: cowboy:http_headers() Send the response trailers and terminate the stream. This function can only be called once, after initiating a response using cowboy_req:stream_reply(3) and sending zero or more body chunks using cowboy_req:stream_body(3) with the nofin argument set. The function stream_trailers/2 implies fin and automatically terminate the response. You must list all field names sent in trailers in the trailer header, otherwise they might be dropped by intermediaries or clients. cowboy_req:stream_trailers(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.stream_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.stream_trailers/ Name cowboy_req:stream_trailers - Send the response trailers Description stream_trailers(Trailers, Req :: cowboy_req:req()) -> ok Trailers :: cowboy:http_headers() Send the response trailers and terminate the stream. This function can only be called once, after initiating a response using cowboy_req:stream_reply(3) and sending zero or more body chunks using cowboy_req:stream_body(3) with the nofin argument set. The function stream_trailers/2 implies fin and automatically terminate the response. You must list all field names sent in trailers in the trailer header, otherwise they might be dropped by intermediaries or clients. cowboy_req:stream_trailers(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.stream_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.stream_trailers/ Name cowboy_req:stream_trailers - Send the response trailers Description stream_trailers(Trailers, Req :: cowboy_req:req()) -> ok Trailers :: cowboy:http_headers() Send the response trailers and terminate the stream. This function can only be called once, after initiating a response using cowboy_req:stream_reply(3) and sending zero or more body chunks using cowboy_req:stream_body(3) with the nofin argument set. The function stream_trailers/2 implies fin and automatically terminate the response. You must list all field names sent in trailers in the trailer header, otherwise they might be dropped by intermediaries or clients. cowboy_req:stream_trailers(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.stream_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.stream_trailers/ Name cowboy_req:stream_trailers - Send the response trailers Description stream_trailers(Trailers, Req :: cowboy_req:req()) -> ok Trailers :: cowboy:http_headers() Send the response trailers and terminate the stream. This function can only be called once, after initiating a response using cowboy_req:stream_reply(3) and sending zero or more body chunks using cowboy_req:stream_body(3) with the nofin argument set. The function stream_trailers/2 implies fin and automatically terminate the response. You must list all field names sent in trailers in the trailer header, otherwise they might be dropped by intermediaries or clients. cowboy_req:uri(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.uri/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.uri/ Name cowboy_req:uri - Reconstructed URI Description uri(Req :: cowboy_req:req()) -> uri(Req, #{}) uri(Req :: cowboy_req:req(), Opts) -> URI :: iodata() Opts :: #{ scheme => iodata() | undefined, host => iodata() | undefined, port => inet:port_number() | undefined, path => iodata() | undefined, qs => iodata() | undefined, fragment => iodata() | undefined } Reconstruct the effective request URI, optionally modifying components. By default Cowboy will build a URI using the components found in the request. cowboy_req:uri(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.uri/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.uri/ Name cowboy_req:uri - Reconstructed URI Description uri(Req :: cowboy_req:req()) -> uri(Req, #{}) uri(Req :: cowboy_req:req(), Opts) -> URI :: iodata() Opts :: #{ scheme => iodata() | undefined, host => iodata() | undefined, port => inet:port_number() | undefined, path => iodata() | undefined, qs => iodata() | undefined, fragment => iodata() | undefined } Reconstruct the effective request URI, optionally modifying components. By default Cowboy will build a URI using the components found in the request. cowboy_req:uri(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.uri/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.uri/ Name cowboy_req:uri - Reconstructed URI Description uri(Req :: cowboy_req:req()) -> uri(Req, #{}) uri(Req :: cowboy_req:req(), Opts) -> URI :: iodata() Opts :: #{ scheme => iodata() | undefined, host => iodata() | undefined, port => inet:port_number() | undefined, path => iodata() | undefined, qs => iodata() | undefined, fragment => iodata() | undefined } Reconstruct the effective request URI, optionally modifying components. By default Cowboy will build a URI using the components found in the request. cowboy_req:uri(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.uri/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.uri/ Name cowboy_req:uri - Reconstructed URI Description uri(Req :: cowboy_req:req()) -> uri(Req, #{}) uri(Req :: cowboy_req:req(), Opts) -> URI :: iodata() Opts :: #{ scheme => iodata() | undefined, host => iodata() | undefined, port => inet:port_number() | undefined, path => iodata() | undefined, qs => iodata() | undefined, fragment => iodata() | undefined } Reconstruct the effective request URI, optionally modifying components. By default Cowboy will build a URI using the components found in the request. cowboy_req:uri(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.uri/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.uri/ Name cowboy_req:uri - Reconstructed URI Description uri(Req :: cowboy_req:req()) -> uri(Req, #{}) uri(Req :: cowboy_req:req(), Opts) -> URI :: iodata() Opts :: #{ scheme => iodata() | undefined, host => iodata() | undefined, port => inet:port_number() | undefined, path => iodata() | undefined, qs => iodata() | undefined, fragment => iodata() | undefined } Reconstruct the effective request URI, optionally modifying components. By default Cowboy will build a URI using the components found in the request. cowboy_req:version(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.version/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_req.version/ Name cowboy_req:version - HTTP version Description version(Req :: cowboy_req:req()) -> Version :: cowboy:http_version() Return the HTTP version used for the request. The version can also be obtained using pattern matching: #{version := Version} = Req. Arguments Req The Req object. Return value The HTTP version used for the request is returned as an atom. It is provided for informative purposes only. Changelog 2.0: Only the version is returned, it is no longer wrapped in a tuple. cowboy_req:version(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.version/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_req.version/ Name cowboy_req:version - HTTP version Description version(Req :: cowboy_req:req()) -> Version :: cowboy:http_version() Return the HTTP version used for the request. The version can also be obtained using pattern matching: #{version := Version} = Req. Arguments Req The Req object. Return value The HTTP version used for the request is returned as an atom. It is provided for informative purposes only. Changelog 2.0: Only the version is returned, it is no longer wrapped in a tuple. cowboy_req:version(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.version/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_req.version/ Name cowboy_req:version - HTTP version Description version(Req :: cowboy_req:req()) -> Version :: cowboy:http_version() Return the HTTP version used for the request. The version can also be obtained using pattern matching: #{version := Version} = Req. Arguments Req The Req object. Return value The HTTP version used for the request is returned as an atom. It is provided for informative purposes only. Changelog 2.0: Only the version is returned, it is no longer wrapped in a tuple. cowboy_req:version(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.version/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_req.version/ Name cowboy_req:version - HTTP version Description version(Req :: cowboy_req:req()) -> Version :: cowboy:http_version() Return the HTTP version used for the request. The version can also be obtained using pattern matching: #{version := Version} = Req. Arguments Req The Req object. Return value The HTTP version used for the request is returned as an atom. It is provided for informative purposes only. Changelog 2.0: Only the version is returned, it is no longer wrapped in a tuple. cowboy_req:version(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.version/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_req.version/ Name cowboy_req:version - HTTP version Description version(Req :: cowboy_req:req()) -> Version :: cowboy:http_version() Return the HTTP version used for the request. The version can also be obtained using pattern matching: #{version := Version} = Req. Arguments Req The Req object. Return value The HTTP version used for the request is returned as an atom. It is provided for informative purposes only. Changelog 2.0: Only the version is returned, it is no longer wrapped in a tuple. cowboy_rest(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_rest/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_rest/ Name cowboy_rest - REST handlers Description The module cowboy_rest implements the HTTP state machine. Implementing REST handlers is not enough to provide a REST interface; this interface must also follow the REST constraints including HATEOAS (hypermedia as the engine of application state). Callbacks REST handlers implement the following interface: init(Req, State) -> {cowboy_rest, Req, State} Callback(Req, State) -> {Result, Req, State} | {stop, Req, State} | {{switch_handler, Module}, Req, State} | {{switch_handler, Module, Opts}, Req, State} terminate(Reason, Req, State) -> ok %% optional Req :: cowboy_req:req() State :: any() Module :: module() Opts :: any() Reason :: normal | {crash, error | exit | throw, any()} Callback - see below Result - see below Default - see below The init/2 callback is common to all handlers. cowboy_rest(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_rest/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_rest/ Name cowboy_rest - REST handlers Description The module cowboy_rest implements the HTTP state machine. Implementing REST handlers is not enough to provide a REST interface; this interface must also follow the REST constraints including HATEOAS (hypermedia as the engine of application state). Callbacks REST handlers implement the following interface: init(Req, State) -> {cowboy_rest, Req, State} Callback(Req, State) -> {Result, Req, State} | {stop, Req, State} | {{switch_handler, Module}, Req, State} | {{switch_handler, Module, Opts}, Req, State} terminate(Reason, Req, State) -> ok %% optional Req :: cowboy_req:req() State :: any() Module :: module() Opts :: any() Reason :: normal | {crash, error | exit | throw, any()} Callback - see below Result - see below Default - see below The init/2 callback is common to all handlers. cowboy_rest(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_rest/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_rest/ Name cowboy_rest - REST handlers Description The module cowboy_rest implements the HTTP state machine. Implementing REST handlers is not enough to provide a REST interface; this interface must also follow the REST constraints including HATEOAS (hypermedia as the engine of application state). Callbacks REST handlers implement the following interface: init(Req, State) -> {cowboy_rest, Req, State} Callback(Req, State) -> {Result, Req, State} | {stop, Req, State} | {{switch_handler, Module}, Req, State} | {{switch_handler, Module, Opts}, Req, State} terminate(Reason, Req, State) -> ok %% optional Req :: cowboy_req:req() State :: any() Module :: module() Opts :: any() Reason :: normal | {crash, error | exit | throw, any()} Callback - see below Result - see below Default - see below The init/2 callback is common to all handlers. cowboy_rest(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_rest/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_rest/ Name cowboy_rest - REST handlers Description The module cowboy_rest implements the HTTP state machine. Implementing REST handlers is not enough to provide a REST interface; this interface must also follow the REST constraints including HATEOAS (hypermedia as the engine of application state). Callbacks REST handlers implement the following interface: init(Req, State) -> {cowboy_rest, Req, State} Callback(Req, State) -> {Result, Req, State} | {stop, Req, State} | {{switch_handler, Module}, Req, State} | {{switch_handler, Module, Opts}, Req, State} terminate(Reason, Req, State) -> ok %% optional Req :: cowboy_req:req() State :: any() Module :: module() Opts :: any() Reason :: normal | {crash, error | exit | throw, any()} Callback - see below Result - see below Default - see below The init/2 callback is common to all handlers. cowboy_rest(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_rest/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_rest/ Name cowboy_rest - REST handlers Description The module cowboy_rest implements the HTTP state machine. Implementing REST handlers is not enough to provide a REST interface; this interface must also follow the REST constraints including HATEOAS (hypermedia as the engine of application state). Callbacks REST handlers implement the following interface: init(Req, State) -> {cowboy_rest, Req, State} Callback(Req, State) -> {Result, Req, State} | {stop, Req, State} | {{switch_handler, Module}, Req, State} | {{switch_handler, Module, Opts}, Req, State} terminate(Reason, Req, State) -> ok %% optional Req :: cowboy_req:req() State :: any() Module :: module() Opts :: any() Reason :: normal | {crash, error | exit | throw, any()} Callback - see below Result - see below Default - see below The init/2 callback is common to all handlers. cowboy_router(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_router/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_router/ Name cowboy_router - Router middleware Description The cowboy_router middleware maps the requested host and path to the handler to be used for processing the request. The router takes the dispatch rules as input from the middleware environment. Dispatch rules are generated by calling the cowboy_router:compile(3) function. When a route matches, the router sets the handler and handler_opts middleware environment values containing the handler module and initial state, respectively. The router will stop execution when no route matches. cowboy_router(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_router/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_router/ Name cowboy_router - Router middleware Description The cowboy_router middleware maps the requested host and path to the handler to be used for processing the request. The router takes the dispatch rules as input from the middleware environment. Dispatch rules are generated by calling the cowboy_router:compile(3) function. When a route matches, the router sets the handler and handler_opts middleware environment values containing the handler module and initial state, respectively. The router will stop execution when no route matches. cowboy_router(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_router/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_router/ Name cowboy_router - Router middleware Description The cowboy_router middleware maps the requested host and path to the handler to be used for processing the request. The router takes the dispatch rules as input from the middleware environment. Dispatch rules are generated by calling the cowboy_router:compile(3) function. When a route matches, the router sets the handler and handler_opts middleware environment values containing the handler module and initial state, respectively. The router will stop execution when no route matches. cowboy_router(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_router/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_router/ Name cowboy_router - Router middleware Description The cowboy_router middleware maps the requested host and path to the handler to be used for processing the request. The router takes the dispatch rules as input from the middleware environment. Dispatch rules are generated by calling the cowboy_router:compile(3) function. When a route matches, the router sets the handler and handler_opts middleware environment values containing the handler module and initial state, respectively. The router will stop execution when no route matches. cowboy_router(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_router/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_router/ Name cowboy_router - Router middleware Description The cowboy_router middleware maps the requested host and path to the handler to be used for processing the request. The router takes the dispatch rules as input from the middleware environment. Dispatch rules are generated by calling the cowboy_router:compile(3) function. When a route matches, the router sets the handler and handler_opts middleware environment values containing the handler module and initial state, respectively. The router will stop execution when no route matches. cowboy_router:compile(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_router.compile/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_router.compile/ Name cowboy_router:compile - Compile routes to the resources Description compile(cowboy_router:routes()) -> cowboy_router:dispatch_rules() Compile routes to the resources. Takes a human readable list of routes and transforms it into a form more efficient to process. Arguments Routes Human readable list of routes. Return value An opaque dispatch rules value is returned. This value must be given to Cowboy as a middleware environment value. Changelog 1.0: Function introduced. Examples Compile routes and start a listener Dispatch = cowboy_router:compile([ {'_', [ {" cowboy_router:compile(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_router.compile/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_router.compile/ Name cowboy_router:compile - Compile routes to the resources Description compile(cowboy_router:routes()) -> cowboy_router:dispatch_rules() Compile routes to the resources. Takes a human readable list of routes and transforms it into a form more efficient to process. Arguments Routes Human readable list of routes. Return value An opaque dispatch rules value is returned. This value must be given to Cowboy as a middleware environment value. Changelog 1.0: Function introduced. Examples Compile routes and start a listener Dispatch = cowboy_router:compile([ {'_', [ {" cowboy_router:compile(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_router.compile/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_router.compile/ Name cowboy_router:compile - Compile routes to the resources Description compile(cowboy_router:routes()) -> cowboy_router:dispatch_rules() Compile routes to the resources. Takes a human readable list of routes and transforms it into a form more efficient to process. Arguments Routes Human readable list of routes. Return value An opaque dispatch rules value is returned. This value must be given to Cowboy as a middleware environment value. Changelog 1.0: Function introduced. Examples Compile routes and start a listener Dispatch = cowboy_router:compile([ {'_', [ {" cowboy_router:compile(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_router.compile/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_router.compile/ Name cowboy_router:compile - Compile routes to the resources Description compile(cowboy_router:routes()) -> cowboy_router:dispatch_rules() Compile routes to the resources. Takes a human readable list of routes and transforms it into a form more efficient to process. Arguments Routes Human readable list of routes. Return value An opaque dispatch rules value is returned. This value must be given to Cowboy as a middleware environment value. Changelog 1.0: Function introduced. Examples Compile routes and start a listener Dispatch = cowboy_router:compile([ {'_', [ {" cowboy_router:compile(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_router.compile/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_router.compile/ Name cowboy_router:compile - Compile routes to the resources Description compile(cowboy_router:routes()) -> cowboy_router:dispatch_rules() Compile routes to the resources. Takes a human readable list of routes and transforms it into a form more efficient to process. Arguments Routes Human readable list of routes. Return value An opaque dispatch rules value is returned. This value must be given to Cowboy as a middleware environment value. Changelog 1.0: Function introduced. Examples Compile routes and start a listener Dispatch = cowboy_router:compile([ {'_', [ {" cowboy_static(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_static/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_static/ Name cowboy_static - Static file handler Description The module cowboy_static implements file serving capabilities using the REST semantics provided by cowboy_rest. The static file handler is a pre-written handler coming with Cowboy. To serve files, use it in your routes. Options opts() :: {priv_file, App, Path} | {priv_file, App, Path, Extra} | {file, Path} | {file, Path, Extra} | {priv_dir, App, Path} | {priv_dir, App, Path, Extra} | {dir, Path} | {dir, Path, Extra} App :: atom() Path :: binary() | string() Extra :: [Etag | Mimetypes] Etag :: {etag, module(), function()} | {etag, false} Mimetypes :: {mimetypes, module(), function()} | {mimetypes, binary() | ParsedMime} ParsedMime :: {Type :: binary(), SubType :: binary(), Params} Params :: [{Key :: binary(), Value :: binary()}] Static handler configuration. cowboy_static(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_static/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_static/ Name cowboy_static - Static file handler Description The module cowboy_static implements file serving capabilities using the REST semantics provided by cowboy_rest. The static file handler is a pre-written handler coming with Cowboy. To serve files, use it in your routes. Options opts() :: {priv_file, App, Path} | {priv_file, App, Path, Extra} | {file, Path} | {file, Path, Extra} | {priv_dir, App, Path} | {priv_dir, App, Path, Extra} | {dir, Path} | {dir, Path, Extra} App :: atom() Path :: binary() | string() Extra :: [Etag | Mimetypes] Etag :: {etag, module(), function()} | {etag, false} Mimetypes :: {mimetypes, module(), function()} | {mimetypes, binary() | ParsedMime} ParsedMime :: {Type :: binary(), SubType :: binary(), Params} Params :: [{Key :: binary(), Value :: binary()}] Static handler configuration. cowboy_static(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_static/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_static/ Name cowboy_static - Static file handler Description The module cowboy_static implements file serving capabilities using the REST semantics provided by cowboy_rest. The static file handler is a pre-written handler coming with Cowboy. To serve files, use it in your routes. Options opts() :: {priv_file, App, Path} | {priv_file, App, Path, Extra} | {file, Path} | {file, Path, Extra} | {priv_dir, App, Path} | {priv_dir, App, Path, Extra} | {dir, Path} | {dir, Path, Extra} App :: atom() Path :: binary() | string() Extra :: [Etag | Mimetypes] Etag :: {etag, module(), function()} | {etag, false} Mimetypes :: {mimetypes, module(), function()} | {mimetypes, binary() | ParsedMime} ParsedMime :: {Type :: binary(), SubType :: binary(), Params} Params :: [{Key :: binary(), Value :: binary()}] Static handler configuration. cowboy_static(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_static/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_static/ Name cowboy_static - Static file handler Description The module cowboy_static implements file serving capabilities using the REST semantics provided by cowboy_rest. The static file handler is a pre-written handler coming with Cowboy. To serve files, use it in your routes. Options opts() :: {priv_file, App, Path} | {priv_file, App, Path, Extra} | {file, Path} | {file, Path, Extra} | {priv_dir, App, Path} | {priv_dir, App, Path, Extra} | {dir, Path} | {dir, Path, Extra} App :: atom() Path :: binary() | string() Extra :: [Etag | Mimetypes] Etag :: {etag, module(), function()} | {etag, false} Mimetypes :: {mimetypes, module(), function()} | {mimetypes, binary() | ParsedMime} ParsedMime :: {Type :: binary(), SubType :: binary(), Params} Params :: [{Key :: binary(), Value :: binary()}] Static handler configuration. cowboy_static(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_static/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_static/ Name cowboy_static - Static file handler Description The module cowboy_static implements file serving capabilities using the REST semantics provided by cowboy_rest. The static file handler is a pre-written handler coming with Cowboy. To serve files, use it in your routes. Options opts() :: {priv_file, App, Path} | {priv_file, App, Path, Extra} | {file, Path} | {file, Path, Extra} | {priv_dir, App, Path} | {priv_dir, App, Path, Extra} | {dir, Path} | {dir, Path, Extra} App :: atom() Path :: binary() | string() Extra :: [Charset | Etag | Mimetypes] Charset :: {charset, module(), function()} | {charset, binary()} Etag :: {etag, module(), function()} | {etag, false} Mimetypes :: {mimetypes, module(), function()} | {mimetypes, binary() | ParsedMime} ParsedMime :: {Type :: binary(), SubType :: binary(), Params} Params :: [{Key :: binary(), Value :: binary()}] Static handler configuration. cowboy_stream(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_stream/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_stream/ Name cowboy_handler - Stream handlers Description The module cowboy_stream defines a callback interface and a protocol for handling HTTP streams. An HTTP request and its associated response is called a stream. A connection may have many streams. In HTTP/1.1 they are executed sequentially, while in HTTP/2 they are executed concurrently. Cowboy calls the stream handler for nearly all events related to a stream. Exceptions vary depending on the protocol. Extra care must be taken when implementing stream handlers to ensure compatibility. cowboy_stream(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_stream/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_stream/ Name cowboy_handler - Stream handlers Description The module cowboy_stream defines a callback interface and a protocol for handling HTTP streams. An HTTP request and its associated response is called a stream. A connection may have many streams. In HTTP/1.1 they are executed sequentially, while in HTTP/2 they are executed concurrently. Cowboy calls the stream handler for nearly all events related to a stream. Exceptions vary depending on the protocol. Extra care must be taken when implementing stream handlers to ensure compatibility. cowboy_stream(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_stream/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_stream/ Name cowboy_handler - Stream handlers Description The module cowboy_stream defines a callback interface and a protocol for handling HTTP streams. An HTTP request and its associated response is called a stream. A connection may have many streams. In HTTP/1.1 they are executed sequentially, while in HTTP/2 they are executed concurrently. Cowboy calls the stream handler for nearly all events related to a stream. Exceptions vary depending on the protocol. Extra care must be taken when implementing stream handlers to ensure compatibility. cowboy_stream(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_stream/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_stream/ Name cowboy_stream - Stream handlers Description The module cowboy_stream defines a callback interface and a protocol for handling HTTP streams. An HTTP request and its associated response is called a stream. A connection may have many streams. In HTTP/1.1 they are executed sequentially, while in HTTP/2 they are executed concurrently. Cowboy calls the stream handler for nearly all events related to a stream. Exceptions vary depending on the protocol. Extra care must be taken when implementing stream handlers to ensure compatibility. cowboy_stream(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_stream/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_stream/ Name cowboy_stream - Stream handlers Description The module cowboy_stream defines a callback interface and a protocol for handling HTTP streams. An HTTP request and its associated response is called a stream. A connection may have many streams. In HTTP/1.1 they are executed sequentially, while in HTTP/2 they are executed concurrently. Cowboy calls the stream handler for nearly all events related to a stream. Exceptions vary depending on the protocol. Extra care must be taken when implementing stream handlers to ensure compatibility. cowboy_stream_h(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_stream_h/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_stream_h/ Name cowboy_stream_h - Default stream handler Description The module cowboy_stream_h is Cowboy's default stream handler and defines much of its behavior. It is responsible for managing the request process, sending it the request body and translating its messages into commands that Cowboy understands. Options opts() :: #{ env => cowboy_middleware:env(), middlewares => [module()], shutdown_timeout => timeout() } Configuration for the default stream handler. The default value is given next to the option name: cowboy_websocket(3) https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.2/manual/cowboy_websocket/ Name cowboy_websocket - Websocket Description The module cowboy_websocket implements Websocket as a Ranch protocol. It also defines a callback interface for handling Websocket connections. Callbacks Websocket handlers must implement the following callback interface: init(Req, State) -> {cowboy_websocket, Req, State} | {cowboy_websocket, Req, State, Opts} websocket_init(State) -> CallResult %% optional websocket_handle(InFrame, State) -> CallResult websocket_info(Info, State) -> CallResult terminate(Reason, PartialReq, State) -> ok %% optional Req :: cowboy_req:req() PartialReq :: map() State :: any() Opts :: cowboy_websocket:opts() InFrame :: {text | binary | ping | pong, binary()} OutFrame :: cow_ws:frame() %% see types below Info :: any() CallResult :: {ok, State} | {ok, State, hibernate} | {reply, OutFrame | [OutFrame], State} | {reply, OutFrame | [OutFrame], State, hibernate} | {stop, State} Reason :: normal | stop | timeout | remote | {remote, cow_ws:close_code(), binary()} | {error, badencoding | badframe | closed | atom()} | {crash, error | exit | throw, any()} The init/2 callback is common to all handlers. cowboy_websocket(3) https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.3/manual/cowboy_websocket/ Name cowboy_websocket - Websocket Description The module cowboy_websocket implements Websocket as a Ranch protocol. It also defines a callback interface for handling Websocket connections. Callbacks Websocket handlers must implement the following callback interface: init(Req, State) -> {cowboy_websocket, Req, State} | {cowboy_websocket, Req, State, Opts} websocket_init(State) -> CallResult %% optional websocket_handle(InFrame, State) -> CallResult websocket_info(Info, State) -> CallResult terminate(Reason, PartialReq, State) -> ok %% optional Req :: cowboy_req:req() PartialReq :: map() State :: any() Opts :: cowboy_websocket:opts() InFrame :: {text | binary | ping | pong, binary()} OutFrame :: cow_ws:frame() %% see types below Info :: any() CallResult :: {ok, State} | {ok, State, hibernate} | {reply, OutFrame | [OutFrame], State} | {reply, OutFrame | [OutFrame], State, hibernate} | {stop, State} Reason :: normal | stop | timeout | remote | {remote, cow_ws:close_code(), binary()} | {error, badencoding | badframe | closed | atom()} | {crash, error | exit | throw, any()} The init/2 callback is common to all handlers. cowboy_websocket(3) https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.4/manual/cowboy_websocket/ Name cowboy_websocket - Websocket Description The module cowboy_websocket implements Websocket as a Ranch protocol. It also defines a callback interface for handling Websocket connections. Callbacks Websocket handlers must implement the following callback interface: init(Req, State) -> {cowboy_websocket, Req, State} | {cowboy_websocket, Req, State, Opts} websocket_init(State) -> CallResult %% optional websocket_handle(InFrame, State) -> CallResult websocket_info(Info, State) -> CallResult terminate(Reason, PartialReq, State) -> ok %% optional Req :: cowboy_req:req() PartialReq :: map() State :: any() Opts :: cowboy_websocket:opts() InFrame :: {text | binary | ping | pong, binary()} OutFrame :: cow_ws:frame() %% see types below Info :: any() CallResult :: {ok, State} | {ok, State, hibernate} | {reply, OutFrame | [OutFrame], State} | {reply, OutFrame | [OutFrame], State, hibernate} | {stop, State} Reason :: normal | stop | timeout | remote | {remote, cow_ws:close_code(), binary()} | {error, badencoding | badframe | closed | atom()} | {crash, error | exit | throw, any()} The init/2 callback is common to all handlers. cowboy_websocket(3) https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.5/manual/cowboy_websocket/ Name cowboy_websocket - Websocket Description The module cowboy_websocket implements Websocket as a Ranch protocol. It also defines a callback interface for handling Websocket connections. Callbacks Websocket handlers must implement the following callback interface: init(Req, State) -> {cowboy_websocket, Req, State} | {cowboy_websocket, Req, State, Opts} websocket_init(State) -> CallResult %% optional websocket_handle(InFrame, State) -> CallResult websocket_info(Info, State) -> CallResult terminate(Reason, PartialReq, State) -> ok %% optional Req :: cowboy_req:req() PartialReq :: map() State :: any() Opts :: cowboy_websocket:opts() InFrame :: ping | pong | {text | binary | ping | pong, binary()} OutFrame :: cow_ws:frame() %% see types below Info :: any() CallResult :: {ok, State} | {ok, State, hibernate} | {reply, OutFrame | [OutFrame], State} | {reply, OutFrame | [OutFrame], State, hibernate} | {stop, State} Reason :: normal | stop | timeout | remote | {remote, cow_ws:close_code(), binary()} | {error, badencoding | badframe | closed | atom()} | {crash, error | exit | throw, any()} The init/2 callback is common to all handlers. cowboy_websocket(3) https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_websocket/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/cowboy/2.6/manual/cowboy_websocket/ Name cowboy_websocket - Websocket Description The module cowboy_websocket implements Websocket as a Ranch protocol. It also defines a callback interface for handling Websocket connections. Callbacks Websocket handlers must implement the following callback interface: init(Req, State) -> {cowboy_websocket, Req, State} | {cowboy_websocket, Req, State, Opts} websocket_init(State) -> CallResult %% optional websocket_handle(InFrame, State) -> CallResult websocket_info(Info, State) -> CallResult terminate(Reason, PartialReq, State) -> ok %% optional Req :: cowboy_req:req() PartialReq :: map() State :: any() Opts :: cowboy_websocket:opts() InFrame :: ping | pong | {text | binary | ping | pong, binary()} OutFrame :: cow_ws:frame() %% see types below Info :: any() CallResult :: {ok, State} | {ok, State, hibernate} | {reply, OutFrame | [OutFrame], State} | {reply, OutFrame | [OutFrame], State, hibernate} | {stop, State} Reason :: normal | stop | timeout | remote | {remote, cow_ws:close_code(), binary()} | {error, badencoding | badframe | closed | atom()} | {crash, error | exit | throw, any()} The init/2 callback is common to all handlers. gun(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun/ Name gun - Asynchronous HTTP client Description The gun module provides an asynchronous interface for connecting and communicating with Web servers over HTTP, HTTP/2 or Websocket. Exports Connection: gun:open(3) - Open a connection to the given host and port gun:open_unix(3) - Open a connection to the given Unix domain socket gun:close(3) - Brutally close the connection gun:info(3) - Obtain information about the connection Requests: gun(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun/ Name gun - Asynchronous HTTP client Description The gun module provides an asynchronous interface for connecting and communicating with Web servers over HTTP, HTTP/2 or Websocket. Exports Connection: gun:open(3) - Open a connection to the given host and port gun:open_unix(3) - Open a connection to the given Unix domain socket gun:close(3) - Brutally close the connection gun:info(3) - Obtain information about the connection Requests: gun(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun/ Name gun - Asynchronous HTTP client Description The gun module provides an asynchronous interface for connecting and communicating with Web servers over HTTP, HTTP/2 or Websocket. Exports Connection: gun:open(3) - Open a connection to the given host and port gun:open_unix(3) - Open a connection to the given Unix domain socket gun:close(3) - Brutally close the connection gun:info(3) - Obtain information about the connection Requests: gun(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun/ Name gun - Asynchronous HTTP client Description The gun module provides an asynchronous interface for connecting and communicating with Web servers over HTTP, HTTP/2 or Websocket. Exports Connection: gun:open(3) - Open a connection to the given host and port gun:open_unix(3) - Open a connection to the given Unix domain socket gun:close(3) - Brutally close the connection gun:info(3) - Obtain information about the connection Requests: gun(7) https://ninenines.eu/docs/en/gun/1.0/manual/gun_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_app/ Name gun - HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP Description Gun is an HTTP client for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Gun aims to provide an easy to use, asynchronous and always-connected client. It maintains a permanent connection to the server and reconnects automatically when necessary. Modules gun(3) - Asynchronous HTTP client Dependencies cowlib(7) - Support library for manipulating Web protocols ssl - Secure communication over sockets All these applications must be started before the gun application. gun(7) https://ninenines.eu/docs/en/gun/1.1/manual/gun_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_app/ Name gun - HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP Description Gun is an HTTP client for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Gun aims to provide an easy to use, asynchronous and always-connected client. It maintains a permanent connection to the server and reconnects automatically when necessary. Modules gun(3) - Asynchronous HTTP client Dependencies cowlib(7) - Support library for manipulating Web protocols ssl - Secure communication over sockets All these applications must be started before the gun application. gun(7) https://ninenines.eu/docs/en/gun/1.2/manual/gun_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_app/ Name gun - HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP Description Gun is an HTTP client for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Gun aims to provide an easy to use, asynchronous and always-connected client. It maintains a permanent connection to the server and reconnects automatically when necessary. Modules gun(3) - Asynchronous HTTP client Dependencies cowlib(7) - Support library for manipulating Web protocols ssl - Secure communication over sockets All these applications must be started before the gun application. gun(7) https://ninenines.eu/docs/en/gun/1.3/manual/gun_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_app/ Name gun - HTTP/1.1, HTTP/2 and Websocket client for Erlang/OTP Description Gun is an HTTP client for Erlang/OTP with support for the HTTP/1.1, HTTP/2 and Websocket protocols. Gun aims to provide an easy to use, asynchronous and always-connected client. It maintains a permanent connection to the server and reconnects automatically when necessary. Modules gun(3) - Asynchronous HTTP client Dependencies cowlib(7) - Support library for manipulating Web protocols ssl - Secure communication over sockets All these applications must be started before the gun application. gun:await(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.await/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.await/ Name gun:await - Wait for a response Description await(ConnPid, StreamRef) -> await(ConnPid, StreamRef, 5000, MonitorRef) await(ConnPid, StreamRef, MonitorRef) -> await(ConnPid, StreamRef, 5000, MonitorRef) await(ConnPid, StreamRef, Timeout) -> await(ConnPid, StreamRef, Timeout, MonitorRef) await(ConnPid, StreamRef, Timeout, MonitorRef) -> Result ConnPid :: pid() StreamRef :: reference() MonitorRef :: reference() Timeout :: timeout() Result :: tuple() - see below Wait for a response. This function waits for a message from the given stream and returns it as a tuple. gun:await(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.await/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.await/ Name gun:await - Wait for a response Description await(ConnPid, StreamRef) -> await(ConnPid, StreamRef, 5000, MonitorRef) await(ConnPid, StreamRef, MonitorRef) -> await(ConnPid, StreamRef, 5000, MonitorRef) await(ConnPid, StreamRef, Timeout) -> await(ConnPid, StreamRef, Timeout, MonitorRef) await(ConnPid, StreamRef, Timeout, MonitorRef) -> Result ConnPid :: pid() StreamRef :: reference() MonitorRef :: reference() Timeout :: timeout() Result :: tuple() - see below Wait for a response. This function waits for a message from the given stream and returns it as a tuple. gun:await(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.await/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.await/ Name gun:await - Wait for a response Description await(ConnPid, StreamRef) -> await(ConnPid, StreamRef, 5000, MonitorRef) await(ConnPid, StreamRef, MonitorRef) -> await(ConnPid, StreamRef, 5000, MonitorRef) await(ConnPid, StreamRef, Timeout) -> await(ConnPid, StreamRef, Timeout, MonitorRef) await(ConnPid, StreamRef, Timeout, MonitorRef) -> Result ConnPid :: pid() StreamRef :: reference() MonitorRef :: reference() Timeout :: timeout() Result :: tuple() - see below Wait for a response. This function waits for a message from the given stream and returns it as a tuple. gun:await(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.await/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.await/ Name gun:await - Wait for a response Description await(ConnPid, StreamRef) -> await(ConnPid, StreamRef, 5000, MonitorRef) await(ConnPid, StreamRef, MonitorRef) -> await(ConnPid, StreamRef, 5000, MonitorRef) await(ConnPid, StreamRef, Timeout) -> await(ConnPid, StreamRef, Timeout, MonitorRef) await(ConnPid, StreamRef, Timeout, MonitorRef) -> Result ConnPid :: pid() StreamRef :: reference() MonitorRef :: reference() Timeout :: timeout() Result :: tuple() - see below Wait for a response. This function waits for a message from the given stream and returns it as a tuple. gun:await_body(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.await_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.await_body/ Name gun:await_body - Wait for the complete response body Description await_body(ConnPid, StreamRef) -> await_body(ConnPid, StreamRef, 5000, MonitorRef) await_body(ConnPid, StreamRef, MonitorRef) -> await_body(ConnPid, StreamRef, 5000, MonitorRef) await_body(ConnPid, StreamRef, Timeout) -> await_body(ConnPid, StreamRef, Timeout, MonitorRef) await_body(ConnPid, StreamRef, Timeout, MonitorRef) -> {ok, Body} | {ok, Body, Trailers} | {error, Reason} ConnPid :: pid() StreamRef :: reference() MonitorRef :: reference() Timeout :: timeout() Body :: binary() Trailers :: [{binary(), binary()}] Reason :: timeout | any() Wait for the complete response body. gun:await_body(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.await_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.await_body/ Name gun:await_body - Wait for the complete response body Description await_body(ConnPid, StreamRef) -> await_body(ConnPid, StreamRef, 5000, MonitorRef) await_body(ConnPid, StreamRef, MonitorRef) -> await_body(ConnPid, StreamRef, 5000, MonitorRef) await_body(ConnPid, StreamRef, Timeout) -> await_body(ConnPid, StreamRef, Timeout, MonitorRef) await_body(ConnPid, StreamRef, Timeout, MonitorRef) -> {ok, Body} | {ok, Body, Trailers} | {error, Reason} ConnPid :: pid() StreamRef :: reference() MonitorRef :: reference() Timeout :: timeout() Body :: binary() Trailers :: [{binary(), binary()}] Reason :: timeout | any() Wait for the complete response body. gun:await_body(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.await_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.await_body/ Name gun:await_body - Wait for the complete response body Description await_body(ConnPid, StreamRef) -> await_body(ConnPid, StreamRef, 5000, MonitorRef) await_body(ConnPid, StreamRef, MonitorRef) -> await_body(ConnPid, StreamRef, 5000, MonitorRef) await_body(ConnPid, StreamRef, Timeout) -> await_body(ConnPid, StreamRef, Timeout, MonitorRef) await_body(ConnPid, StreamRef, Timeout, MonitorRef) -> {ok, Body} | {ok, Body, Trailers} | {error, Reason} ConnPid :: pid() StreamRef :: reference() MonitorRef :: reference() Timeout :: timeout() Body :: binary() Trailers :: [{binary(), binary()}] Reason :: timeout | any() Wait for the complete response body. gun:await_body(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.await_body/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.await_body/ Name gun:await_body - Wait for the complete response body Description await_body(ConnPid, StreamRef) -> await_body(ConnPid, StreamRef, 5000, MonitorRef) await_body(ConnPid, StreamRef, MonitorRef) -> await_body(ConnPid, StreamRef, 5000, MonitorRef) await_body(ConnPid, StreamRef, Timeout) -> await_body(ConnPid, StreamRef, Timeout, MonitorRef) await_body(ConnPid, StreamRef, Timeout, MonitorRef) -> {ok, Body} | {ok, Body, Trailers} | {error, Reason} ConnPid :: pid() StreamRef :: reference() MonitorRef :: reference() Timeout :: timeout() Body :: binary() Trailers :: [{binary(), binary()}] Reason :: timeout | any() Wait for the complete response body. gun:await_up(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.await_up/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.await_up/ Name gun:await_up - Wait for the connection to be up Description await_up(ConnPid) -> await_up(ConnPid, 5000, MonitorRef) await_up(ConnPid, MonitorRef) -> await_up(ConnPid, 5000, MonitorRef) await_up(ConnPid, Timeout) -> await_up(ConnPid, Timeout, MonitorRef) await_up(ConnPid, Timeout, MonitorRef) -> {ok, Protocol} | {error, Reason} ConnPid :: pid() MonitorRef :: reference() Timeout :: timeout() Protocol :: http | http2 Reason :: timeout | any() Wait for the connection to be up. Arguments ConnPid The pid of the Gun connection process. gun:await_up(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.await_up/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.await_up/ Name gun:await_up - Wait for the connection to be up Description await_up(ConnPid) -> await_up(ConnPid, 5000, MonitorRef) await_up(ConnPid, MonitorRef) -> await_up(ConnPid, 5000, MonitorRef) await_up(ConnPid, Timeout) -> await_up(ConnPid, Timeout, MonitorRef) await_up(ConnPid, Timeout, MonitorRef) -> {ok, Protocol} | {error, Reason} ConnPid :: pid() MonitorRef :: reference() Timeout :: timeout() Protocol :: http | http2 Reason :: timeout | any() Wait for the connection to be up. Arguments ConnPid The pid of the Gun connection process. gun:await_up(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.await_up/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.await_up/ Name gun:await_up - Wait for the connection to be up Description await_up(ConnPid) -> await_up(ConnPid, 5000, MonitorRef) await_up(ConnPid, MonitorRef) -> await_up(ConnPid, 5000, MonitorRef) await_up(ConnPid, Timeout) -> await_up(ConnPid, Timeout, MonitorRef) await_up(ConnPid, Timeout, MonitorRef) -> {ok, Protocol} | {error, Reason} ConnPid :: pid() MonitorRef :: reference() Timeout :: timeout() Protocol :: http | http2 Reason :: timeout | any() Wait for the connection to be up. Arguments ConnPid The pid of the Gun connection process. gun:await_up(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.await_up/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.await_up/ Name gun:await_up - Wait for the connection to be up Description await_up(ConnPid) -> await_up(ConnPid, 5000, MonitorRef) await_up(ConnPid, MonitorRef) -> await_up(ConnPid, 5000, MonitorRef) await_up(ConnPid, Timeout) -> await_up(ConnPid, Timeout, MonitorRef) await_up(ConnPid, Timeout, MonitorRef) -> {ok, Protocol} | {error, Reason} ConnPid :: pid() MonitorRef :: reference() Timeout :: timeout() Protocol :: http | http2 Reason :: timeout | any() Wait for the connection to be up. Arguments ConnPid The pid of the Gun connection process. gun:cancel(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.cancel/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.cancel/ Name gun:cancel - Cancel the given stream Description cancel(ConnPid, StreamRef) -> ok ConnPid :: pid() StreamRef :: reference() Cancel the given stream. The behavior of this function depends on the protocol selected. HTTP/1.1 does not support this feature. Gun will simply silence the stream and stop relaying messages. Gun may also decide to close the connection if the response body is too large, to avoid wasting time and bandwidth. gun:cancel(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.cancel/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.cancel/ Name gun:cancel - Cancel the given stream Description cancel(ConnPid, StreamRef) -> ok ConnPid :: pid() StreamRef :: reference() Cancel the given stream. The behavior of this function depends on the protocol selected. HTTP/1.1 does not support this feature. Gun will simply silence the stream and stop relaying messages. Gun may also decide to close the connection if the response body is too large, to avoid wasting time and bandwidth. gun:cancel(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.cancel/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.cancel/ Name gun:cancel - Cancel the given stream Description cancel(ConnPid, StreamRef) -> ok ConnPid :: pid() StreamRef :: reference() Cancel the given stream. The behavior of this function depends on the protocol selected. HTTP/1.1 does not support this feature. Gun will simply silence the stream and stop relaying messages. Gun may also decide to close the connection if the response body is too large, to avoid wasting time and bandwidth. gun:cancel(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.cancel/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.cancel/ Name gun:cancel - Cancel the given stream Description cancel(ConnPid, StreamRef) -> ok ConnPid :: pid() StreamRef :: reference() Cancel the given stream. The behavior of this function depends on the protocol selected. HTTP/1.1 does not support this feature. Gun will simply silence the stream and stop relaying messages. Gun may also decide to close the connection if the response body is too large, to avoid wasting time and bandwidth. gun:close(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.close/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.close/ Name gun:close - Brutally close the connection Description close(ConnPid) -> ok ConnPid :: pid() Brutally close the connection. Arguments ConnPid The pid of the Gun connection process. Return value The atom ok is returned. Changelog 1.0: Function introduced. Examples Close the connection ok = gun:close(ConnPid). See also gun(3), gun:open(3), gun:open_unix(3) gun:close(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.close/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.close/ Name gun:close - Brutally close the connection Description close(ConnPid) -> ok ConnPid :: pid() Brutally close the connection. Arguments ConnPid The pid of the Gun connection process. Return value The atom ok is returned. Changelog 1.0: Function introduced. Examples Close the connection ok = gun:close(ConnPid). See also gun(3), gun:open(3), gun:open_unix(3) gun:close(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.close/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.close/ Name gun:close - Brutally close the connection Description close(ConnPid) -> ok ConnPid :: pid() Brutally close the connection. Arguments ConnPid The pid of the Gun connection process. Return value The atom ok is returned. Changelog 1.0: Function introduced. Examples Close the connection ok = gun:close(ConnPid). See also gun(3), gun:open(3), gun:open_unix(3) gun:close(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.close/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.close/ Name gun:close - Brutally close the connection Description close(ConnPid) -> ok ConnPid :: pid() Brutally close the connection. Arguments ConnPid The pid of the Gun connection process. Return value The atom ok is returned. Changelog 1.0: Function introduced. Examples Close the connection ok = gun:close(ConnPid). See also gun(3), gun:open(3), gun:open_unix(3) gun:connect(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.connect/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.connect/ Name gun:connect - Establish a tunnel to the origin server Description connect(ConnPid, Destination) -> connect(ConnPid, Destination, [], #{}). connect(ConnPid, Destination, Headers) -> connect(ConnPid, Destination, Headers, #{}). connect(ConnPid, Destination, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Destination :: gun:connect_destination() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Establish a tunnel to the origin server. This feature is currently only available for HTTP/1.1 connections. Upon successful completion of the CONNECT request a tunnel is established and subsequent requests will go through the tunnel. gun:connect(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.connect/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.connect/ Name gun:connect - Establish a tunnel to the origin server Description connect(ConnPid, Destination) -> connect(ConnPid, Destination, [], #{}). connect(ConnPid, Destination, Headers) -> connect(ConnPid, Destination, Headers, #{}). connect(ConnPid, Destination, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Destination :: gun:connect_destination() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Establish a tunnel to the origin server. This feature is currently only available for HTTP/1.1 connections. Upon successful completion of the CONNECT request a tunnel is established and subsequent requests will go through the tunnel. gun:data(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.data/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.data/ Name gun:data - Stream the body of a request Description data(ConnPid, StreamRef, IsFin, Data) -> ok ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Data :: iodata() Stream the body of a request. This function can only be used if the original request had headers indicating that a body would be streamed. All calls to this function must use the nofin flag except for the last which must use fin to indicate the end of the request body. gun:data(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.data/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.data/ Name gun:data - Stream the body of a request Description data(ConnPid, StreamRef, IsFin, Data) -> ok ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Data :: iodata() Stream the body of a request. This function can only be used if the original request had headers indicating that a body would be streamed. All calls to this function must use the nofin flag except for the last which must use fin to indicate the end of the request body. gun:data(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.data/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.data/ Name gun:data - Stream the body of a request Description data(ConnPid, StreamRef, IsFin, Data) -> ok ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Data :: iodata() Stream the body of a request. This function can only be used if the original request had headers indicating that a body would be streamed. All calls to this function must use the nofin flag except for the last which must use fin to indicate the end of the request body. gun:data(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.data/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.data/ Name gun:data - Stream the body of a request Description data(ConnPid, StreamRef, IsFin, Data) -> ok ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Data :: iodata() Stream the body of a request. This function can only be used if the original request had headers indicating that a body would be streamed. All calls to this function must use the nofin flag except for the last which must use fin to indicate the end of the request body. gun:delete(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.delete/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.delete/ Name gun:delete - Delete a resource Description delete(ConnPid, Path) -> delete(ConnPid, Path, [], #{}). delete(ConnPid, Path, Headers) -> delete(ConnPid, Path, Headers, #{}) delete(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Delete a resource. Arguments ConnPid The pid of the Gun connection process. Path Path to the resource. Headers Additional request headers. ReqOpts Request options. gun:delete(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.delete/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.delete/ Name gun:delete - Delete a resource Description delete(ConnPid, Path) -> delete(ConnPid, Path, [], #{}). delete(ConnPid, Path, Headers) -> delete(ConnPid, Path, Headers, #{}) delete(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Delete a resource. Arguments ConnPid The pid of the Gun connection process. Path Path to the resource. Headers Additional request headers. ReqOpts Request options. gun:delete(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.delete/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.delete/ Name gun:delete - Delete a resource Description delete(ConnPid, Path) -> delete(ConnPid, Path, [], #{}). delete(ConnPid, Path, Headers) -> delete(ConnPid, Path, Headers, #{}) delete(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Delete a resource. Arguments ConnPid The pid of the Gun connection process. Path Path to the resource. Headers Additional request headers. ReqOpts Request options. gun:delete(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.delete/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.delete/ Name gun:delete - Delete a resource Description delete(ConnPid, Path) -> delete(ConnPid, Path, [], #{}). delete(ConnPid, Path, Headers) -> delete(ConnPid, Path, Headers, #{}) delete(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Delete a resource. Arguments ConnPid The pid of the Gun connection process. Path Path to the resource. Headers Additional request headers. ReqOpts Request options. gun:flush(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.flush/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.flush/ Name gun:flush - Flush all messages related to a connection or a stream Description flush(ConnPid) -> ok flush(StreamRef) -> ok ConnPid :: pid() StreamRef :: reference() Flush all messages related to a connection or a stream. Arguments Either of these arguments may be provided: ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. Return value The atom ok is returned. gun:flush(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.flush/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.flush/ Name gun:flush - Flush all messages related to a connection or a stream Description flush(ConnPid) -> ok flush(StreamRef) -> ok ConnPid :: pid() StreamRef :: reference() Flush all messages related to a connection or a stream. Arguments Either of these arguments may be provided: ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. Return value The atom ok is returned. gun:flush(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.flush/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.flush/ Name gun:flush - Flush all messages related to a connection or a stream Description flush(ConnPid) -> ok flush(StreamRef) -> ok ConnPid :: pid() StreamRef :: reference() Flush all messages related to a connection or a stream. Arguments Either of these arguments may be provided: ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. Return value The atom ok is returned. gun:flush(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.flush/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.flush/ Name gun:flush - Flush all messages related to a connection or a stream Description flush(ConnPid) -> ok flush(StreamRef) -> ok ConnPid :: pid() StreamRef :: reference() Flush all messages related to a connection or a stream. Arguments Either of these arguments may be provided: ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. Return value The atom ok is returned. gun:get(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.get/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.get/ Name gun:get - Get a resource representation Description get(ConnPid, Path) -> get(ConnPid, Path, [], #{}). get(ConnPid, Path, Headers) -> get(ConnPid, Path, Headers, #{}) get(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Get a resource representation. Arguments ConnPid The pid of the Gun connection process. Path Path to the resource. Headers Additional request headers. gun:get(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.get/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.get/ Name gun:get - Get a resource representation Description get(ConnPid, Path) -> get(ConnPid, Path, [], #{}). get(ConnPid, Path, Headers) -> get(ConnPid, Path, Headers, #{}) get(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Get a resource representation. Arguments ConnPid The pid of the Gun connection process. Path Path to the resource. Headers Additional request headers. gun:get(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.get/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.get/ Name gun:get - Get a resource representation Description get(ConnPid, Path) -> get(ConnPid, Path, [], #{}). get(ConnPid, Path, Headers) -> get(ConnPid, Path, Headers, #{}) get(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Get a resource representation. Arguments ConnPid The pid of the Gun connection process. Path Path to the resource. Headers Additional request headers. gun:get(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.get/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.get/ Name gun:get - Get a resource representation Description get(ConnPid, Path) -> get(ConnPid, Path, [], #{}). get(ConnPid, Path, Headers) -> get(ConnPid, Path, Headers, #{}) get(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Get a resource representation. Arguments ConnPid The pid of the Gun connection process. Path Path to the resource. Headers Additional request headers. gun:head(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.head/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.head/ Name gun:head - Get headers of a resource representation Description head(ConnPid, Path) -> head(ConnPid, Path, [], #{}). head(ConnPid, Path, Headers) -> head(ConnPid, Path, Headers, #{}) head(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Get headers of a resource representation. This function performs the same operation as gun:get(3), except the server will not send the resource representation, only the response's status code and headers. gun:head(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.head/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.head/ Name gun:head - Get headers of a resource representation Description head(ConnPid, Path) -> head(ConnPid, Path, [], #{}). head(ConnPid, Path, Headers) -> head(ConnPid, Path, Headers, #{}) head(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Get headers of a resource representation. This function performs the same operation as gun:get(3), except the server will not send the resource representation, only the response's status code and headers. gun:head(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.head/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.head/ Name gun:head - Get headers of a resource representation Description head(ConnPid, Path) -> head(ConnPid, Path, [], #{}). head(ConnPid, Path, Headers) -> head(ConnPid, Path, Headers, #{}) head(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Get headers of a resource representation. This function performs the same operation as gun:get(3), except the server will not send the resource representation, only the response's status code and headers. gun:head(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.head/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.head/ Name gun:head - Get headers of a resource representation Description head(ConnPid, Path) -> head(ConnPid, Path, [], #{}). head(ConnPid, Path, Headers) -> head(ConnPid, Path, Headers, #{}) head(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Get headers of a resource representation. This function performs the same operation as gun:get(3), except the server will not send the resource representation, only the response's status code and headers. gun:info(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.info/ Name gun:info - Obtain information about the connection Description info(ConnPid) -> Info ConnPid :: pid() Info :: #{ sock_ip => inet:ip_address(), sock_port => inet:port_number() } Obtain information about the connection. Arguments ConnPid The pid of the Gun connection process. Return value A map is returned containing various informations about the connection. Changelog 1.0: Function introduced. Examples Obtain information about the connection Info = gun:info(ConnPid). See also gun(3), gun:open(3), gun:open_unix(3) gun:info(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.info/ Name gun:info - Obtain information about the connection Description info(ConnPid) -> Info ConnPid :: pid() Info :: #{ sock_ip => inet:ip_address(), sock_port => inet:port_number() } Obtain information about the connection. Arguments ConnPid The pid of the Gun connection process. Return value A map is returned containing various informations about the connection. Changelog 1.0: Function introduced. Examples Obtain information about the connection Info = gun:info(ConnPid). See also gun(3), gun:open(3), gun:open_unix(3) gun:info(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.info/ Name gun:info - Obtain information about the connection Description info(ConnPid) -> Info ConnPid :: pid() Info :: #{ sock_ip => inet:ip_address(), sock_port => inet:port_number() } Obtain information about the connection. Arguments ConnPid The pid of the Gun connection process. Return value A map is returned containing various informations about the connection. Changelog 1.0: Function introduced. Examples Obtain information about the connection Info = gun:info(ConnPid). See also gun(3), gun:open(3), gun:open_unix(3) gun:info(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.info/ Name gun:info - Obtain information about the connection Description info(ConnPid) -> Info ConnPid :: pid() Info :: #{ socket => inet:socket() | ssl:sslsocket(), transport => tcp | tls, protocol => http | http2 | ws, sock_ip => inet:ip_address(), sock_port => inet:port_number(), origin_host => inet:hostname() | inet:ip_address(), origin_port => inet:port_number(), intermediaries => [Intermediary] } Intermediary :: #{ type => connect, host => inet:hostname() | inet:ip_address(), port => inet:port_number(), transport => tcp | tls, protocol => http | http2 } Obtain information about the connection. gun:open(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.open/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.open/ Name gun:open - Open a connection to the given host and port Description open(Host, Port) -> open(Host, Port, #{}) open(Host, Port, Opts) -> {ok, pid()} | {error, any()} Host :: inet:hostname() | inet:ip_address() Port :: inet:port_number() Opts :: gun:opts() Open a connection to the given host and port. Arguments Host Host or IP address to connect to. Port Port to connect to. Opts Options for this connection. gun:open(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.open/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.open/ Name gun:open - Open a connection to the given host and port Description open(Host, Port) -> open(Host, Port, #{}) open(Host, Port, Opts) -> {ok, pid()} | {error, any()} Host :: inet:hostname() | inet:ip_address() Port :: inet:port_number() Opts :: gun:opts() Open a connection to the given host and port. Arguments Host Host or IP address to connect to. Port Port to connect to. Opts Options for this connection. gun:open(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.open/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.open/ Name gun:open - Open a connection to the given host and port Description open(Host, Port) -> open(Host, Port, #{}) open(Host, Port, Opts) -> {ok, pid()} | {error, any()} Host :: inet:hostname() | inet:ip_address() Port :: inet:port_number() Opts :: gun:opts() Open a connection to the given host and port. Arguments Host Host or IP address to connect to. Port Port to connect to. Opts Options for this connection. gun:open(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.open/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.open/ Name gun:open - Open a connection to the given host and port Description open(Host, Port) -> open(Host, Port, #{}) open(Host, Port, Opts) -> {ok, pid()} | {error, any()} Host :: inet:hostname() | inet:ip_address() Port :: inet:port_number() Opts :: gun:opts() Open a connection to the given host and port. Arguments Host Host or IP address to connect to. Port Port to connect to. Opts Options for this connection. gun:open_unix(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.open_unix/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.open_unix/ Name gun:open_unix - Open a connection to the given Unix domain socket Description open_unix(SocketPath, Opts) -> {ok, pid()} | {error, any()} SocketPath :: string() Opts :: gun:opts() Open a connection to the given Unix domain socket. Arguments SocketPath Path to the Unix domain socket to connect to. Opts Options for this connection. Return value The pid of the newly created Gun process is returned. Note that this does not indicate that the connection has been successfully opened; the gun_up(3) message will be sent for that. gun:open_unix(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.open_unix/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.open_unix/ Name gun:open_unix - Open a connection to the given Unix domain socket Description open_unix(SocketPath, Opts) -> {ok, pid()} | {error, any()} SocketPath :: string() Opts :: gun:opts() Open a connection to the given Unix domain socket. Arguments SocketPath Path to the Unix domain socket to connect to. Opts Options for this connection. Return value The pid of the newly created Gun process is returned. Note that this does not indicate that the connection has been successfully opened; the gun_up(3) message will be sent for that. gun:open_unix(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.open_unix/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.open_unix/ Name gun:open_unix - Open a connection to the given Unix domain socket Description open_unix(SocketPath, Opts) -> {ok, pid()} | {error, any()} SocketPath :: string() Opts :: gun:opts() Open a connection to the given Unix domain socket. Arguments SocketPath Path to the Unix domain socket to connect to. Opts Options for this connection. Return value The pid of the newly created Gun process is returned. Note that this does not indicate that the connection has been successfully opened; the gun_up(3) message will be sent for that. gun:open_unix(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.open_unix/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.open_unix/ Name gun:open_unix - Open a connection to the given Unix domain socket Description open_unix(SocketPath, Opts) -> {ok, pid()} | {error, any()} SocketPath :: string() Opts :: gun:opts() Open a connection to the given Unix domain socket. Arguments SocketPath Path to the Unix domain socket to connect to. Opts Options for this connection. Return value The pid of the newly created Gun process is returned. Note that this does not indicate that the connection has been successfully opened; the gun_up(3) message will be sent for that. gun:options(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.options/ Name gun:options - Query the capabilities of the server or a resource Description options(ConnPid, Path) -> options(ConnPid, Path, [], #{}). options(ConnPid, Path, Headers) -> options(ConnPid, Path, Headers, #{}) options(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Query the capabilities of the server or a resource. The special path "*" can be used to obtain information about the server as a whole. gun:options(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.options/ Name gun:options - Query the capabilities of the server or a resource Description options(ConnPid, Path) -> options(ConnPid, Path, [], #{}). options(ConnPid, Path, Headers) -> options(ConnPid, Path, Headers, #{}) options(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Query the capabilities of the server or a resource. The special path "*" can be used to obtain information about the server as a whole. gun:options(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.options/ Name gun:options - Query the capabilities of the server or a resource Description options(ConnPid, Path) -> options(ConnPid, Path, [], #{}). options(ConnPid, Path, Headers) -> options(ConnPid, Path, Headers, #{}) options(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Query the capabilities of the server or a resource. The special path "*" can be used to obtain information about the server as a whole. gun:options(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.options/ Name gun:options - Query the capabilities of the server or a resource Description options(ConnPid, Path) -> options(ConnPid, Path, [], #{}). options(ConnPid, Path, Headers) -> options(ConnPid, Path, Headers, #{}) options(ConnPid, Path, Headers, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] ReqOpts :: gun:req_opts() StreamRef :: reference() Query the capabilities of the server or a resource. The special path "*" can be used to obtain information about the server as a whole. gun:patch(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.patch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.patch/ Name gun:patch - Apply a set of changes to a resource Description patch(ConnPid, Path, Headers) -> StreamRef patch(ConnPid, Path, Headers, Body) -> patch(ConnPid, Path, Headers, Body, #{}) patch(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Apply a set of changes to a resource. The behavior of this function varies depending on whether a body is provided. gun:patch(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.patch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.patch/ Name gun:patch - Apply a set of changes to a resource Description patch(ConnPid, Path, Headers) -> StreamRef patch(ConnPid, Path, Headers, Body) -> patch(ConnPid, Path, Headers, Body, #{}) patch(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Apply a set of changes to a resource. The behavior of this function varies depending on whether a body is provided. gun:patch(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.patch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.patch/ Name gun:patch - Apply a set of changes to a resource Description patch(ConnPid, Path, Headers) -> StreamRef patch(ConnPid, Path, Headers, Body) -> patch(ConnPid, Path, Headers, Body, #{}) patch(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Apply a set of changes to a resource. The behavior of this function varies depending on whether a body is provided. gun:patch(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.patch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.patch/ Name gun:patch - Apply a set of changes to a resource Description patch(ConnPid, Path, Headers) -> StreamRef patch(ConnPid, Path, Headers, Body) -> patch(ConnPid, Path, Headers, Body, #{}) patch(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Apply a set of changes to a resource. The behavior of this function varies depending on whether a body is provided. gun:post(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.post/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.post/ Name gun:post - Process the enclosed representation according to a resource's own semantics Description post(ConnPid, Path, Headers) -> StreamRef post(ConnPid, Path, Headers, Body) -> post(ConnPid, Path, Headers, Body, #{}) post(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Process the enclosed representation according to a resource's own semantics. The behavior of this function varies depending on whether a body is provided. gun:post(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.post/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.post/ Name gun:post - Process the enclosed representation according to a resource's own semantics Description post(ConnPid, Path, Headers) -> StreamRef post(ConnPid, Path, Headers, Body) -> post(ConnPid, Path, Headers, Body, #{}) post(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Process the enclosed representation according to a resource's own semantics. The behavior of this function varies depending on whether a body is provided. gun:post(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.post/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.post/ Name gun:post - Process the enclosed representation according to a resource's own semantics Description post(ConnPid, Path, Headers) -> StreamRef post(ConnPid, Path, Headers, Body) -> post(ConnPid, Path, Headers, Body, #{}) post(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Process the enclosed representation according to a resource's own semantics. The behavior of this function varies depending on whether a body is provided. gun:post(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.post/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.post/ Name gun:post - Process the enclosed representation according to a resource's own semantics Description post(ConnPid, Path, Headers) -> StreamRef post(ConnPid, Path, Headers, Body) -> post(ConnPid, Path, Headers, Body, #{}) post(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Process the enclosed representation according to a resource's own semantics. The behavior of this function varies depending on whether a body is provided. gun:put(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.put/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.put/ Name gun:put - Create or replace a resource Description put(ConnPid, Path, Headers) -> StreamRef put(ConnPid, Path, Headers, Body) -> put(ConnPid, Path, Headers, Body, #{}) put(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Create or replace a resource. The behavior of this function varies depending on whether a body is provided. The function put/3 expects either a content-length or content-type header to indicate that a body will be sent afterwards. gun:put(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.put/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.put/ Name gun:put - Create or replace a resource Description put(ConnPid, Path, Headers) -> StreamRef put(ConnPid, Path, Headers, Body) -> put(ConnPid, Path, Headers, Body, #{}) put(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Create or replace a resource. The behavior of this function varies depending on whether a body is provided. The function put/3 expects either a content-length or content-type header to indicate that a body will be sent afterwards. gun:put(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.put/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.put/ Name gun:put - Create or replace a resource Description put(ConnPid, Path, Headers) -> StreamRef put(ConnPid, Path, Headers, Body) -> put(ConnPid, Path, Headers, Body, #{}) put(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Create or replace a resource. The behavior of this function varies depending on whether a body is provided. The function put/3 expects either a content-length or content-type header to indicate that a body will be sent afterwards. gun:put(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.put/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.put/ Name gun:put - Create or replace a resource Description put(ConnPid, Path, Headers) -> StreamRef put(ConnPid, Path, Headers, Body) -> put(ConnPid, Path, Headers, Body, #{}) put(ConnPid, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Create or replace a resource. The behavior of this function varies depending on whether a body is provided. The function put/3 expects either a content-length or content-type header to indicate that a body will be sent afterwards. gun:request(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.request/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.request/ Name gun:request - Perform the given request Description request(ConnPid, Method, Path, Headers) -> StreamRef request(ConnPid, Method, Path, Headers, Body) -> request(ConnPid, Method, Path, Headers, Body, #{}) request(ConnPid, Method, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Method :: binary() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Perform the given request. This is a general purpose function that should only be used when other method-specific functions do not apply. gun:request(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.request/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.request/ Name gun:request - Perform the given request Description request(ConnPid, Method, Path, Headers) -> StreamRef request(ConnPid, Method, Path, Headers, Body) -> request(ConnPid, Method, Path, Headers, Body, #{}) request(ConnPid, Method, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Method :: binary() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Perform the given request. This is a general purpose function that should only be used when other method-specific functions do not apply. gun:request(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.request/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.request/ Name gun:request - Perform the given request Description request(ConnPid, Method, Path, Headers) -> StreamRef request(ConnPid, Method, Path, Headers, Body) -> request(ConnPid, Method, Path, Headers, Body, #{}) request(ConnPid, Method, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Method :: binary() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Perform the given request. This is a general purpose function that should only be used when other method-specific functions do not apply. gun:request(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.request/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.request/ Name gun:request - Perform the given request Description request(ConnPid, Method, Path, Headers) -> StreamRef request(ConnPid, Method, Path, Headers, Body) -> request(ConnPid, Method, Path, Headers, Body, #{}) request(ConnPid, Method, Path, Headers, Body, ReqOpts) -> StreamRef ConnPid :: pid() Method :: binary() Path :: iodata() Headers :: [{binary(), iodata()}] Body :: iodata() ReqOpts :: gun:req_opts() StreamRef :: reference() Perform the given request. This is a general purpose function that should only be used when other method-specific functions do not apply. gun:ws_send(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.ws_send/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.ws_send/ Name gun:ws_send - Send Websocket frames Description ws_send(ConnPid, Frames) -> ok ConnPid :: pid() Frames :: Frame | [Frame] Frame :: close | ping | pong | {text | binary | close | ping | pong, iodata()} | {close, non_neg_integer(), iodata()} Send Websocket frames. The connection must first be upgraded to Websocket using the function gun:ws_upgrade(3). Arguments ConnPid The pid of the Gun connection process. Frames A Websocket frame. gun:ws_send(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.ws_send/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.ws_send/ Name gun:ws_send - Send Websocket frames Description ws_send(ConnPid, Frames) -> ok ConnPid :: pid() Frames :: Frame | [Frame] Frame :: close | ping | pong | {text | binary | close | ping | pong, iodata()} | {close, non_neg_integer(), iodata()} Send Websocket frames. The connection must first be upgraded to Websocket using the function gun:ws_upgrade(3). Arguments ConnPid The pid of the Gun connection process. Frames A Websocket frame. gun:ws_send(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.ws_send/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.ws_send/ Name gun:ws_send - Send Websocket frames Description ws_send(ConnPid, Frames) -> ok ConnPid :: pid() Frames :: Frame | [Frame] Frame :: close | ping | pong | {text | binary | close | ping | pong, iodata()} | {close, non_neg_integer(), iodata()} Send Websocket frames. The connection must first be upgraded to Websocket using the function gun:ws_upgrade(3). Arguments ConnPid The pid of the Gun connection process. Frames A Websocket frame. gun:ws_send(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.ws_send/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.ws_send/ Name gun:ws_send - Send Websocket frames Description ws_send(ConnPid, Frames) -> ok ConnPid :: pid() Frames :: Frame | [Frame] Frame :: close | ping | pong | {text | binary | close | ping | pong, iodata()} | {close, non_neg_integer(), iodata()} Send Websocket frames. The connection must first be upgraded to Websocket using the function gun:ws_upgrade(3). Arguments ConnPid The pid of the Gun connection process. Frames A Websocket frame. gun:ws_upgrade(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun.ws_upgrade/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun.ws_upgrade/ Name gun:ws_upgrade - Upgrade to Websocket Description ws_upgrade(ConnPid, Path) -> ws_upgrade(ConnPid, Path, []) ws_upgrade(ConnPid, Path, Headers) -> StreamRef ws_upgrade(ConnPid, Path, Headers, WsOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] WsOpts :: gun:ws_opts StreamRef :: reference() Upgrade to Websocket. The behavior of this function depends on the protocol selected. HTTP/1.1 cannot handle Websocket and HTTP requests concurrently. The upgrade, if successful, will result in the complete takeover of the connection. gun:ws_upgrade(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun.ws_upgrade/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun.ws_upgrade/ Name gun:ws_upgrade - Upgrade to Websocket Description ws_upgrade(ConnPid, Path) -> ws_upgrade(ConnPid, Path, []) ws_upgrade(ConnPid, Path, Headers) -> StreamRef ws_upgrade(ConnPid, Path, Headers, WsOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] WsOpts :: gun:ws_opts StreamRef :: reference() Upgrade to Websocket. The behavior of this function depends on the protocol selected. HTTP/1.1 cannot handle Websocket and HTTP requests concurrently. The upgrade, if successful, will result in the complete takeover of the connection. gun:ws_upgrade(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun.ws_upgrade/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun.ws_upgrade/ Name gun:ws_upgrade - Upgrade to Websocket Description ws_upgrade(ConnPid, Path) -> ws_upgrade(ConnPid, Path, []) ws_upgrade(ConnPid, Path, Headers) -> StreamRef ws_upgrade(ConnPid, Path, Headers, WsOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] WsOpts :: gun:ws_opts StreamRef :: reference() Upgrade to Websocket. The behavior of this function depends on the protocol selected. HTTP/1.1 cannot handle Websocket and HTTP requests concurrently. The upgrade, if successful, will result in the complete takeover of the connection. gun:ws_upgrade(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun.ws_upgrade/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun.ws_upgrade/ Name gun:ws_upgrade - Upgrade to Websocket Description ws_upgrade(ConnPid, Path) -> ws_upgrade(ConnPid, Path, []) ws_upgrade(ConnPid, Path, Headers) -> StreamRef ws_upgrade(ConnPid, Path, Headers, WsOpts) -> StreamRef ConnPid :: pid() Path :: iodata() Headers :: [{binary(), iodata()}] WsOpts :: gun:ws_opts StreamRef :: reference() Upgrade to Websocket. The behavior of this function depends on the protocol selected. HTTP/1.1 cannot handle Websocket and HTTP requests concurrently. The upgrade, if successful, will result in the complete takeover of the connection. gun_data(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_data/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_data/ Name gun_data - Response body Description {gun_data, ConnPid, StreamRef, IsFin, Data} ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Data :: binary() Response body. This message informs the relevant process that the server sent a all or part of the body for the response to the original request. A data message is always preceded by a response message. The response body may be terminated either by a data message with the flag fin set or by a gun_trailers(3) message. gun_data(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_data/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_data/ Name gun_data - Response body Description {gun_data, ConnPid, StreamRef, IsFin, Data} ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Data :: binary() Response body. This message informs the relevant process that the server sent a all or part of the body for the response to the original request. A data message is always preceded by a response message. The response body may be terminated either by a data message with the flag fin set or by a gun_trailers(3) message. gun_data(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_data/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_data/ Name gun_data - Response body Description {gun_data, ConnPid, StreamRef, IsFin, Data} ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Data :: binary() Response body. This message informs the relevant process that the server sent a all or part of the body for the response to the original request. A data message is always preceded by a response message. The response body may be terminated either by a data message with the flag fin set or by a gun_trailers(3) message. gun_data(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_data/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_data/ Name gun_data - Response body Description {gun_data, ConnPid, StreamRef, IsFin, Data} ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Data :: binary() Response body. This message informs the relevant process that the server sent a all or part of the body for the response to the original request. A data message is always preceded by a response message. The response body may be terminated either by a data message with the flag fin set or by a gun_trailers(3) message. gun_down(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_down/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_down/ Name gun_down - The connection is down Description {gun_down, ConnPid, Protocol, Reason, KilledStreams, UnprocessedStreams} ConnPid :: pid() Protocol :: http | http2 | ws Reason :: any() KilledStreams :: [reference()] UnprocessedStreams :: [reference()] The connection is down. This message informs the owner process that the connection was lost. Depending on the retry and retry_timeout options Gun may automatically attempt to reconnect. When the connection goes back up, Gun will not attempt to retry requests. gun_down(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_down/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_down/ Name gun_down - The connection is down Description {gun_down, ConnPid, Protocol, Reason, KilledStreams, UnprocessedStreams} ConnPid :: pid() Protocol :: http | http2 | ws Reason :: any() KilledStreams :: [reference()] UnprocessedStreams :: [reference()] The connection is down. This message informs the owner process that the connection was lost. Depending on the retry and retry_timeout options Gun may automatically attempt to reconnect. When the connection goes back up, Gun will not attempt to retry requests. gun_down(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_down/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_down/ Name gun_down - The connection is down Description {gun_down, ConnPid, Protocol, Reason, KilledStreams, UnprocessedStreams} ConnPid :: pid() Protocol :: http | http2 | ws Reason :: any() KilledStreams :: [reference()] UnprocessedStreams :: [reference()] The connection is down. This message informs the owner process that the connection was lost. Depending on the retry and retry_timeout options Gun may automatically attempt to reconnect. When the connection goes back up, Gun will not attempt to retry requests. gun_down(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_down/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_down/ Name gun_down - The connection is down Description {gun_down, ConnPid, Protocol, Reason, KilledStreams, UnprocessedStreams} ConnPid :: pid() Protocol :: http | http2 | ws Reason :: any() KilledStreams :: [reference()] UnprocessedStreams :: [reference()] The connection is down. This message informs the owner process that the connection was lost. Depending on the retry and retry_timeout options Gun may automatically attempt to reconnect. When the connection goes back up, Gun will not attempt to retry requests. gun_error(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_error/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_error/ Name gun_error - Stream or connection-wide error Description {gun_error, ConnPid, StreamRef, Reason} {gun_error, ConnPid, Reason} ConnPid :: pid() StreamRef :: reference() Reason :: any() Stream or connection-wide error. These messages inform the relevant process that an error occurred. A reference is given when the error pertains to a specific stream. Connection-wide errors do not imply that the connection is no longer usable, they are used for all errors that are not specific to a stream. gun_error(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_error/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_error/ Name gun_error - Stream or connection-wide error Description {gun_error, ConnPid, StreamRef, Reason} {gun_error, ConnPid, Reason} ConnPid :: pid() StreamRef :: reference() Reason :: any() Stream or connection-wide error. These messages inform the relevant process that an error occurred. A reference is given when the error pertains to a specific stream. Connection-wide errors do not imply that the connection is no longer usable, they are used for all errors that are not specific to a stream. gun_error(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_error/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_error/ Name gun_error - Stream or connection-wide error Description {gun_error, ConnPid, StreamRef, Reason} {gun_error, ConnPid, Reason} ConnPid :: pid() StreamRef :: reference() Reason :: any() Stream or connection-wide error. These messages inform the relevant process that an error occurred. A reference is given when the error pertains to a specific stream. Connection-wide errors do not imply that the connection is no longer usable, they are used for all errors that are not specific to a stream. gun_error(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_error/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_error/ Name gun_error - Stream or connection-wide error Description {gun_error, ConnPid, StreamRef, Reason} {gun_error, ConnPid, Reason} ConnPid :: pid() StreamRef :: reference() Reason :: any() Stream or connection-wide error. These messages inform the relevant process that an error occurred. A reference is given when the error pertains to a specific stream. Connection-wide errors do not imply that the connection is no longer usable, they are used for all errors that are not specific to a stream. gun_inform(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_inform/ Name gun_inform - Informational response Description {gun_inform, ConnPid, StreamRef, Status, Headers} ConnPid :: pid() StreamRef :: reference() Status :: 100..199 Headers :: [{binary(), binary()}] Informational response. This message informs the relevant process that the server sent an informational response to the original request. Informational responses are only intermediate responses and provide no guarantees as to what the final response will be. An informational response always precedes the response to the original request. gun_inform(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_inform/ Name gun_inform - Informational response Description {gun_inform, ConnPid, StreamRef, Status, Headers} ConnPid :: pid() StreamRef :: reference() Status :: 100..199 Headers :: [{binary(), binary()}] Informational response. This message informs the relevant process that the server sent an informational response to the original request. Informational responses are only intermediate responses and provide no guarantees as to what the final response will be. An informational response always precedes the response to the original request. gun_inform(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_inform/ Name gun_inform - Informational response Description {gun_inform, ConnPid, StreamRef, Status, Headers} ConnPid :: pid() StreamRef :: reference() Status :: 100..199 Headers :: [{binary(), binary()}] Informational response. This message informs the relevant process that the server sent an informational response to the original request. Informational responses are only intermediate responses and provide no guarantees as to what the final response will be. An informational response always precedes the response to the original request. gun_inform(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_inform/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_inform/ Name gun_inform - Informational response Description {gun_inform, ConnPid, StreamRef, Status, Headers} ConnPid :: pid() StreamRef :: reference() Status :: 100..199 Headers :: [{binary(), binary()}] Informational response. This message informs the relevant process that the server sent an informational response to the original request. Informational responses are only intermediate responses and provide no guarantees as to what the final response will be. An informational response always precedes the response to the original request. gun_push(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_push/ Name gun_push - Server-initiated push Description {gun_push, ConnPid, StreamRef, NewStreamRef, Method, URI, Headers} ConnPid :: pid() StreamRef :: reference() NewStreamRef :: reference() Method :: binary() URI :: binary() Headers :: [{binary(), binary()}] Server-initiated push. This message informs the relevant process that the server is pushing a resource related to the effective target URI of the original request. A server-initiated push message always precedes the response to the original request. gun_push(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_push/ Name gun_push - Server-initiated push Description {gun_push, ConnPid, StreamRef, NewStreamRef, Method, URI, Headers} ConnPid :: pid() StreamRef :: reference() NewStreamRef :: reference() Method :: binary() URI :: binary() Headers :: [{binary(), binary()}] Server-initiated push. This message informs the relevant process that the server is pushing a resource related to the effective target URI of the original request. A server-initiated push message always precedes the response to the original request. gun_push(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_push/ Name gun_push - Server-initiated push Description {gun_push, ConnPid, StreamRef, NewStreamRef, Method, URI, Headers} ConnPid :: pid() StreamRef :: reference() NewStreamRef :: reference() Method :: binary() URI :: binary() Headers :: [{binary(), binary()}] Server-initiated push. This message informs the relevant process that the server is pushing a resource related to the effective target URI of the original request. A server-initiated push message always precedes the response to the original request. gun_push(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_push/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_push/ Name gun_push - Server-initiated push Description {gun_push, ConnPid, StreamRef, NewStreamRef, Method, URI, Headers} ConnPid :: pid() StreamRef :: reference() NewStreamRef :: reference() Method :: binary() URI :: binary() Headers :: [{binary(), binary()}] Server-initiated push. This message informs the relevant process that the server is pushing a resource related to the effective target URI of the original request. A server-initiated push message always precedes the response to the original request. gun_response(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_response/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_response/ Name gun_response - Response Description {gun_response, ConnPid, StreamRef, IsFin, Status, Headers} ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Status :: non_neg_integer() Headers :: [{binary(), binary()}] Response. This message informs the relevant process that the server sent a response to the original request. Elements ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. IsFin Whether this message terminates the response. gun_response(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_response/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_response/ Name gun_response - Response Description {gun_response, ConnPid, StreamRef, IsFin, Status, Headers} ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Status :: non_neg_integer() Headers :: [{binary(), binary()}] Response. This message informs the relevant process that the server sent a response to the original request. Elements ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. IsFin Whether this message terminates the response. gun_response(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_response/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_response/ Name gun_response - Response Description {gun_response, ConnPid, StreamRef, IsFin, Status, Headers} ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Status :: non_neg_integer() Headers :: [{binary(), binary()}] Response. This message informs the relevant process that the server sent a response to the original request. Elements ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. IsFin Whether this message terminates the response. gun_response(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_response/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_response/ Name gun_response - Response Description {gun_response, ConnPid, StreamRef, IsFin, Status, Headers} ConnPid :: pid() StreamRef :: reference() IsFin :: fin | nofin Status :: non_neg_integer() Headers :: [{binary(), binary()}] Response. This message informs the relevant process that the server sent a response to the original request. Elements ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. IsFin Whether this message terminates the response. gun_trailers(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_trailers/ Name gun_trailers - Response trailers Description {gun_trailers, ConnPid, StreamRef, Headers} ConnPid :: pid() StreamRef :: reference() Headers :: [{binary(), binary()}] Response trailers. This message informs the relevant process that the server sent response trailers for the response to the original request. A trailers message terminates the response. Elements ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. Headers Trailing headers sent after the response body. gun_trailers(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_trailers/ Name gun_trailers - Response trailers Description {gun_trailers, ConnPid, StreamRef, Headers} ConnPid :: pid() StreamRef :: reference() Headers :: [{binary(), binary()}] Response trailers. This message informs the relevant process that the server sent response trailers for the response to the original request. A trailers message terminates the response. Elements ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. Headers Trailing headers sent after the response body. gun_trailers(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_trailers/ Name gun_trailers - Response trailers Description {gun_trailers, ConnPid, StreamRef, Headers} ConnPid :: pid() StreamRef :: reference() Headers :: [{binary(), binary()}] Response trailers. This message informs the relevant process that the server sent response trailers for the response to the original request. A trailers message terminates the response. Elements ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. Headers Trailing headers sent after the response body. gun_trailers(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_trailers/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_trailers/ Name gun_trailers - Response trailers Description {gun_trailers, ConnPid, StreamRef, Headers} ConnPid :: pid() StreamRef :: reference() Headers :: [{binary(), binary()}] Response trailers. This message informs the relevant process that the server sent response trailers for the response to the original request. A trailers message terminates the response. Elements ConnPid The pid of the Gun connection process. StreamRef Identifier of the stream for the original request. Headers Trailing headers sent after the response body. gun_up(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_up/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_up/ Name gun_up - The connection is up Description {gun_up, ConnPid, Protocol} ConnPid :: pid() Protocol :: http | http2 The connection is up. This message informs the owner process that the connection or reconnection completed. Gun will now start processing the messages it received while waiting for the connection to be up. If this is a reconnection, then this may not be desirable for all requests. Those requests should be cancelled when the connection goes down, and any subsequent messages ignored. gun_up(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_up/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_up/ Name gun_up - The connection is up Description {gun_up, ConnPid, Protocol} ConnPid :: pid() Protocol :: http | http2 The connection is up. This message informs the owner process that the connection or reconnection completed. Gun will now start processing the messages it received while waiting for the connection to be up. If this is a reconnection, then this may not be desirable for all requests. Those requests should be cancelled when the connection goes down, and any subsequent messages ignored. gun_up(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_up/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_up/ Name gun_up - The connection is up Description {gun_up, ConnPid, Protocol} ConnPid :: pid() Protocol :: http | http2 The connection is up. This message informs the owner process that the connection or reconnection completed. Gun will now start processing the messages it received while waiting for the connection to be up. If this is a reconnection, then this may not be desirable for all requests. Those requests should be cancelled when the connection goes down, and any subsequent messages ignored. gun_up(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_up/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_up/ Name gun_up - The connection is up Description {gun_up, ConnPid, Protocol} ConnPid :: pid() Protocol :: http | http2 The connection is up. This message informs the owner process that the connection or reconnection completed. Gun will now start processing the messages it received while waiting for the connection to be up. If this is a reconnection, then this may not be desirable for all requests. Those requests should be cancelled when the connection goes down, and any subsequent messages ignored. gun_upgrade(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_upgrade/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_upgrade/ Name gun_upgrade - Successful protocol upgrade Description {gun_upgrade, ConnPid, StreamRef, Protocols, Headers} ConnPid :: pid() StreamRef :: reference() Protocols :: [<<"websocket">>] Headers :: [{binary(), binary()}] Successful protocol upgrade. This message informs the relevant process that the server accepted to upgrade to one or more protocols given in the original request. The exact semantics of this message depend on the original protocol. HTTP/1.1 upgrades apply to the entire connection. HTTP/2 uses a different mechanism which allows switching specific streams to a different protocol. gun_upgrade(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_upgrade/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_upgrade/ Name gun_upgrade - Successful protocol upgrade Description {gun_upgrade, ConnPid, StreamRef, Protocols, Headers} ConnPid :: pid() StreamRef :: reference() Protocols :: [<<"websocket">>] Headers :: [{binary(), binary()}] Successful protocol upgrade. This message informs the relevant process that the server accepted to upgrade to one or more protocols given in the original request. The exact semantics of this message depend on the original protocol. HTTP/1.1 upgrades apply to the entire connection. HTTP/2 uses a different mechanism which allows switching specific streams to a different protocol. gun_upgrade(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_upgrade/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_upgrade/ Name gun_upgrade - Successful protocol upgrade Description {gun_upgrade, ConnPid, StreamRef, Protocols, Headers} ConnPid :: pid() StreamRef :: reference() Protocols :: [<<"websocket">>] Headers :: [{binary(), binary()}] Successful protocol upgrade. This message informs the relevant process that the server accepted to upgrade to one or more protocols given in the original request. The exact semantics of this message depend on the original protocol. HTTP/1.1 upgrades apply to the entire connection. HTTP/2 uses a different mechanism which allows switching specific streams to a different protocol. gun_upgrade(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_upgrade/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_upgrade/ Name gun_upgrade - Successful protocol upgrade Description {gun_upgrade, ConnPid, StreamRef, Protocols, Headers} ConnPid :: pid() StreamRef :: reference() Protocols :: [<<"websocket">>] Headers :: [{binary(), binary()}] Successful protocol upgrade. This message informs the relevant process that the server accepted to upgrade to one or more protocols given in the original request. The exact semantics of this message depend on the original protocol. HTTP/1.1 upgrades apply to the entire connection. HTTP/2 uses a different mechanism which allows switching specific streams to a different protocol. gun_ws(3) https://ninenines.eu/docs/en/gun/1.0/manual/gun_ws/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.0/manual/gun_ws/ Name gun_ws - Websocket frame Description {gun_ws, ConnPid, StreamRef, Frame} ConnPid :: pid() StreamRef :: reference() Frame :: close | {text | binary | close, binary()} | {close, non_neg_integer(), binary()} Websocket frame. This message informs the relevant process that the server sent the enclosed frame. This message can only be sent on streams that were upgraded to the Websocket protocol. Elements ConnPid The pid of the Gun connection process. gun_ws(3) https://ninenines.eu/docs/en/gun/1.1/manual/gun_ws/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.1/manual/gun_ws/ Name gun_ws - Websocket frame Description {gun_ws, ConnPid, StreamRef, Frame} ConnPid :: pid() StreamRef :: reference() Frame :: close | {text | binary | close, binary()} | {close, non_neg_integer(), binary()} Websocket frame. This message informs the relevant process that the server sent the enclosed frame. This message can only be sent on streams that were upgraded to the Websocket protocol. Elements ConnPid The pid of the Gun connection process. gun_ws(3) https://ninenines.eu/docs/en/gun/1.2/manual/gun_ws/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.2/manual/gun_ws/ Name gun_ws - Websocket frame Description {gun_ws, ConnPid, StreamRef, Frame} ConnPid :: pid() StreamRef :: reference() Frame :: close | {text | binary | close, binary()} | {close, non_neg_integer(), binary()} Websocket frame. This message informs the relevant process that the server sent the enclosed frame. This message can only be sent on streams that were upgraded to the Websocket protocol. Elements ConnPid The pid of the Gun connection process. gun_ws(3) https://ninenines.eu/docs/en/gun/1.3/manual/gun_ws/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/gun/1.3/manual/gun_ws/ Name gun_ws - Websocket frame Description {gun_ws, ConnPid, StreamRef, Frame} ConnPid :: pid() StreamRef :: reference() Frame :: close | {text | binary | close, binary()} | {close, non_neg_integer(), binary()} Websocket frame. This message informs the relevant process that the server sent the enclosed frame. This message can only be sent on streams that were upgraded to the Websocket protocol. Elements ConnPid The pid of the Gun connection process. ranch(3) https://ninenines.eu/docs/en/ranch/1.4/manual/ranch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/manual/ranch/ Name ranch - socket acceptor pool Description The ranch module provides functions for starting and manipulating Ranch listeners. Types max_conns() = non_neg_integer() | infinity Maximum number of connections allowed on this listener. This is a soft limit. The actual number of connections might be slightly above the limit due to concurrency when accepting new connections. Some connections may also be removed from this count explicitly by the user code. opt() opt() = {ack_timeout, timeout()} | {connection_type, worker | supervisor} | {max_connections, max_conns()} | {num_acceptors, pos_integer()} | {shutdown, timeout() | brutal_kill} | {socket, any()} Ranch-specific transport options. ranch(3) https://ninenines.eu/docs/en/ranch/1.5/manual/ranch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/manual/ranch/ Name ranch - socket acceptor pool Description The ranch module provides functions for starting and manipulating Ranch listeners. Types max_conns() = non_neg_integer() | infinity Maximum number of connections allowed on this listener. This is a soft limit. The actual number of connections might be slightly above the limit due to concurrency when accepting new connections. Some connections may also be removed from this count explicitly by the user code. opt() opt() = {ack_timeout, timeout()} | {connection_type, worker | supervisor} | {max_connections, max_conns()} | {num_acceptors, pos_integer()} | {shutdown, timeout() | brutal_kill} | {socket, any()} Ranch-specific transport options. ranch(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch/ Name ranch - Socket acceptor pool Description The module ranch provides functions for starting and manipulating Ranch listeners. Exports Start/stop: ranch:start_listener(3) - Start a listener ranch:stop_listener(3) - Stop a listener ranch:child_spec(3) - Build child specifications for a new listener Suspend/resume: ranch:suspend_listener(3) - Suspend a running listener ranch:resume_listener(3) - Resume a suspended listener ranch:get_status(3) - Get a listener's running state Connections: ranch:accept_ack(3) - Deprecated in favor of ranch:handshake(3) ranch:handshake(3) - Perform the transport handshake ranch:remove_connection(3) - Remove connection from the count Options: ranch(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch/ Name ranch - Socket acceptor pool Description The module ranch provides functions for starting and manipulating Ranch listeners. Exports Start/stop: ranch:start_listener(3) - Start a listener ranch:stop_listener(3) - Stop a listener ranch:child_spec(3) - Build child specifications for a new listener Suspend/resume: ranch:suspend_listener(3) - Suspend a running listener ranch:resume_listener(3) - Resume a suspended listener ranch:get_status(3) - Get a listener's running state Connections: ranch:accept_ack(3) - Deprecated in favor of ranch:handshake(3) ranch:handshake(3) - Perform the transport handshake ranch:recv_proxy_header(3) - Receive the PROXY protocol header ranch:remove_connection(3) - Remove connection from the count Options: ranch(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch/ Name ranch - Socket acceptor pool Description The module ranch provides functions for starting and manipulating Ranch listeners. Exports Start/stop: ranch:start_listener(3) - Start a listener ranch:stop_listener(3) - Stop a listener ranch:child_spec(3) - Build child specifications for a new listener Suspend/resume: ranch:suspend_listener(3) - Suspend a running listener ranch:resume_listener(3) - Resume a suspended listener ranch:get_status(3) - Get a listener's running state Connections: ranch:handshake(3) - Perform the transport handshake ranch:recv_proxy_header(3) - Receive the PROXY protocol header ranch:remove_connection(3) - Remove connection from the count Options: ranch(7) https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_app/ Name ranch - Socket acceptor pool for TCP protocols. Dependencies The ranch application depends on the ssl application to start. It is used for handling secure connections, when the transport is ranch_ssl. It can be disabled if SSL is not used. Environment The ranch application defines one application environment configuration parameter. profile (false) When enabled, Ranch will start eprof profiling automatically. You can use the ranch_app:profile_output/0 function to stop profiling and output the results to the files procs. ranch(7) https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_app/ Name ranch - Socket acceptor pool for TCP protocols. Dependencies The ranch application depends on the ssl application to start. It is used for handling secure connections, when the transport is ranch_ssl. It can be disabled if SSL is not used. Environment The ranch application defines one application environment configuration parameter. profile (false) When enabled, Ranch will start eprof profiling automatically. You can use the ranch_app:profile_output/0 function to stop profiling and output the results to the files procs. ranch(7) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_app/ Name ranch - Socket acceptor pool for TCP protocols Description Ranch is a socket acceptor pool for TCP protocols. Ranch manages listeners which are a set of processes that accept and manage connections. The connection's transport and protocol modules are configured per listener. Listeners can be inspected and reconfigured without interruptions in service. Modules Functions: ranch(3) - Socket acceptor pool Transports: ranch_ssl(3) - SSL transport ranch_tcp(3) - TLS transport Behaviors: ranch(7) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_app/ Name ranch - Socket acceptor pool for TCP protocols Description Ranch is a socket acceptor pool for TCP protocols. Ranch manages listeners which are a set of processes that accept and manage connections. The connection's transport and protocol modules are configured per listener. Listeners can be inspected and reconfigured without interruptions in service. Modules Functions: ranch(3) - Socket acceptor pool ranch_proxy_header(3) - PROXY protocol Transports: ranch_ssl(3) - SSL transport ranch_tcp(3) - TCP transport Behaviors: ranch(7) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_app/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_app/ Name ranch - Socket acceptor pool for TCP protocols Description Ranch is a socket acceptor pool for TCP protocols. Ranch manages listeners which are a set of processes that accept and manage connections. The connection's transport and protocol modules are configured per listener. Listeners can be inspected and reconfigured without interruptions in service. Modules Functions: ranch(3) - Socket acceptor pool ranch_proxy_header(3) - PROXY protocol Transports: ranch_ssl(3) - SSL transport ranch_tcp(3) - TCP transport Behaviors: ranch:child_spec(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.child_spec/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.child_spec/ Name ranch:child_spec - Build child specifications for a new listener Description child_spec(Ref :: ranch_ref(), Transport :: module(), TransOpts :: ranch:opts(), Protocol :: module(), ProtoOpts :: any()) -> supervisor:child_spec() Build child specifications for a new listener. This function can be used to embed a listener directly in an application's supervision tree. Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. ranch:child_spec(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.child_spec/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.child_spec/ Name ranch:child_spec - Build child specifications for a new listener Description child_spec(Ref :: ranch_ref(), Transport :: module(), TransOpts :: ranch:opts(), Protocol :: module(), ProtoOpts :: any()) -> supervisor:child_spec() Build child specifications for a new listener. This function can be used to embed a listener directly in an application's supervision tree. Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. ranch:child_spec(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.child_spec/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.child_spec/ Name ranch:child_spec - Build child specifications for a new listener Description child_spec(Ref :: ranch_ref(), Transport :: module(), TransOpts :: ranch:opts(), Protocol :: module(), ProtoOpts :: any()) -> supervisor:child_spec() Build child specifications for a new listener which can be embedded directly in an application's supervision tree. The actual listener is placed under a supervisor which monitors ranch_server via a proxy process and will restart the listener if ranch_server crashes. Arguments Ref The listener name is used to refer to this listener in future calls, for example when updating the configuration. ranch:get_addr(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_addr/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_addr/ Name ranch:get_addr - Get the listening port and IP Description get_addr(Ref :: ranch:ref()) -> {IP :: inet:ip_address(), Port :: inet:port_number()} Get the listening port and IP. Arguments Ref The listener name. Return value The address of the listener is returned as a tuple. The IP address is the IP of the network interface the socket is bound to. Examples Get the listening port and IP {IP, Port} = ranch:get_addr(example). ranch:get_addr(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_addr/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_addr/ Name ranch:get_addr - Get the listening port and IP Description get_addr(Ref :: ranch:ref()) -> {IP :: inet:ip_address(), Port :: inet:port_number()} Get the listening port and IP. Arguments Ref The listener name. Return value The address of the listener is returned as a tuple. The IP address is the IP of the network interface the socket is bound to. Examples Get the listening port and IP {IP, Port} = ranch:get_addr(example). ranch:get_addr(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_addr/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_addr/ Name ranch:get_addr - Get the listening address Description get_addr(Ref :: ranch:ref()) -> {IP :: inet:ip_address(), Port :: inet:port_number()} | {local, SocketFile :: binary()} | {undefined, undefined} Get the listening address. Arguments Ref The listener name. Return value The address of the listener is returned as a tuple of the form {IP, Port} when listening on a network interface, or {local, SocketFile} when listening on a UNIX Domain socket. ranch:get_max_connections(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_max_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_max_connections/ Name ranch:get_max_connections - Get the max number of connections Description get_max_connections(Ref :: ranch:ref()) -> MaxConns :: ranch:max_conns() Get the max number of connections. Arguments Ref The listener name. Return value The maximum number of connections is returned. Examples Get the max number of connections MaxConns = ranch:get_max_connections(example). See also ranch:get_protocol_options(3), ranch:get_transport_options(3), ranch:set_max_connections(3), ranch(3) ranch:get_max_connections(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_max_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_max_connections/ Name ranch:get_max_connections - Get the max number of connections Description get_max_connections(Ref :: ranch:ref()) -> MaxConns :: ranch:max_conns() Get the max number of connections. Arguments Ref The listener name. Return value The maximum number of connections is returned. Examples Get the max number of connections MaxConns = ranch:get_max_connections(example). See also ranch:get_protocol_options(3), ranch:get_transport_options(3), ranch:set_max_connections(3), ranch(3) ranch:get_max_connections(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_max_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_max_connections/ Name ranch:get_max_connections - Get the max number of connections per connection supervisor Description get_max_connections(Ref :: ranch:ref()) -> MaxConns :: ranch:max_conns() Get the max number of connections per connection supervisor. Arguments Ref The listener name. Return value The maximum number of connections per connection supervisor is returned. Changelog 2.0: The maximum number of connections is now per connection supervisor. Examples Get the max number of connections per connection supervisor MaxConns = ranch:get_max_connections(example). ranch:get_port(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_port/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_port/ Name ranch:get_port - Get the listening port Description get_port(Ref :: ranch:ref()) -> Port :: inet:port_number() Get the listening port. This function is particularly useful to retrieve the listening port number when it was not provided in the options and was chosen randomly instead. Arguments Ref The listener name. Return value The listening port is returned. Examples Get the listening port Port = ranch:get_port(example). See also ranch:start_listener(3), ranch:get_addr(3), ranch:info(3), ranch(3) ranch:get_port(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_port/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_port/ Name ranch:get_port - Get the listening port Description get_port(Ref :: ranch:ref()) -> Port :: inet:port_number() Get the listening port. This function is particularly useful to retrieve the listening port number when it was not provided in the options and was chosen randomly instead. Arguments Ref The listener name. Return value The listening port is returned. Examples Get the listening port Port = ranch:get_port(example). See also ranch:start_listener(3), ranch:get_addr(3), ranch:info(3), ranch(3) ranch:get_port(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_port/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_port/ Name ranch:get_port - Get the listening port Description get_port(Ref :: ranch:ref()) -> Port :: inet:port_number() | undefined Get the listening port. This function is particularly useful to retrieve the listening port number when it was not provided in the options and was chosen randomly instead. Arguments Ref The listener name. Return value The listening port is returned. When the listener is suspended or using a UNIX Domain socket instead of a network interface, undefined will be returned. ranch:get_protocol_options(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_protocol_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_protocol_options/ Name ranch:get_protocol_options - Get the current protocol options Description get_protocol_options(Ref :: ranch:ref()) -> ProtoOpts :: any() Get the current protocol options. Arguments Ref The listener name. Return value The current protocol options are returned. Examples Get the current protocol options ProtoOpts = ranch:get_protocol_options(example). See also ranch:get_max_connections(3), ranch:get_transport_options(3), ranch:set_protocol_options(3), ranch(3) ranch:get_protocol_options(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_protocol_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_protocol_options/ Name ranch:get_protocol_options - Get the current protocol options Description get_protocol_options(Ref :: ranch:ref()) -> ProtoOpts :: any() Get the current protocol options. Arguments Ref The listener name. Return value The current protocol options are returned. Examples Get the current protocol options ProtoOpts = ranch:get_protocol_options(example). See also ranch:get_max_connections(3), ranch:get_transport_options(3), ranch:set_protocol_options(3), ranch(3) ranch:get_protocol_options(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_protocol_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_protocol_options/ Name ranch:get_protocol_options - Get the current protocol options Description get_protocol_options(Ref :: ranch:ref()) -> ProtoOpts :: any() Get the current protocol options. Arguments Ref The listener name. Return value The current protocol options are returned. Examples Get the current protocol options ProtoOpts = ranch:get_protocol_options(example). See also ranch:get_max_connections(3), ranch:get_transport_options(3), ranch:set_protocol_options(3), ranch(3) ranch:get_status(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_status/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_status/ Name ranch:get_status - Get a listener's running state Description get_status(Ref :: ranch_ref()) -> running | suspended Get a listener's running state. Arguments Ref The listener name. Return value An atom is returned indicating the running status of the listener. Changelog 1.6: Function introduced. Examples Get a listener's running state ranch:get_status(example). See also ranch:start_listener(3), ranch:stop_listener(3), ranch:suspend_listener(3), ranch:resume_listener(3), ranch:set_transport_options(3), ranch:wait_for_connections(3), ranch(3) ranch:get_status(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_status/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_status/ Name ranch:get_status - Get a listener's running state Description get_status(Ref :: ranch_ref()) -> running | suspended Get a listener's running state. Arguments Ref The listener name. Return value An atom is returned indicating the running status of the listener. Changelog 1.6: Function introduced. Examples Get a listener's running state ranch:get_status(example). See also ranch:start_listener(3), ranch:stop_listener(3), ranch:suspend_listener(3), ranch:resume_listener(3), ranch:set_transport_options(3), ranch:wait_for_connections(3), ranch(3) ranch:get_status(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_status/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_status/ Name ranch:get_status - Get a listener's running state Description get_status(Ref :: ranch_ref()) -> running | suspended Get a listener's running state. Arguments Ref The listener name. Return value An atom is returned indicating the running status of the listener. Changelog 1.6: Function introduced. Examples Get a listener's running state ranch:get_status(example). See also ranch:start_listener(3), ranch:stop_listener(3), ranch:suspend_listener(3), ranch:resume_listener(3), ranch:set_transport_options(3), ranch:wait_for_connections(3), ranch(3) ranch:get_transport_options(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_transport_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.get_transport_options/ Name ranch:get_transport_options - Get the current transport options Description get_transport_options(Ref :: ranch:ref()) -> TransOpts :: any() Get the current transport options. Arguments Ref The listener name. Return value The current transport options are returned. Examples Get the current transport options TransOpts = ranch:get_transport_options(example). See also ranch:get_max_connections(3), ranch:get_protocol_options(3), ranch:set_transport_options(3), ranch(3) ranch:get_transport_options(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_transport_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.get_transport_options/ Name ranch:get_transport_options - Get the current transport options Description get_transport_options(Ref :: ranch:ref()) -> TransOpts :: any() Get the current transport options. Arguments Ref The listener name. Return value The current transport options are returned. Examples Get the current transport options TransOpts = ranch:get_transport_options(example). See also ranch:get_max_connections(3), ranch:get_protocol_options(3), ranch:set_transport_options(3), ranch(3) ranch:get_transport_options(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_transport_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.get_transport_options/ Name ranch:get_transport_options - Get the current transport options Description get_transport_options(Ref :: ranch:ref()) -> TransOpts :: any() Get the current transport options. Arguments Ref The listener name. Return value The current transport options are returned. Examples Get the current transport options TransOpts = ranch:get_transport_options(example). See also ranch:get_max_connections(3), ranch:get_protocol_options(3), ranch:set_transport_options(3), ranch(3) ranch:handshake(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.handshake/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.handshake/ Name ranch:handshake - Perform the transport handshake Description handshake(Ref) -> handshake(Ref, []) handshake(Ref, Opts) -> {ok, Socket} Ref :: ranch:ref() Opts :: any() Socket :: any() Perform the transport handshake. This function must be called by the protocol process in order to retrieve the socket for the connection. Ranch performs the handshake necessary to give control of the socket to this process and also does the transport handshake, for example setting up the TLS connection. ranch:handshake(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.handshake/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.handshake/ Name ranch:handshake - Perform the transport handshake Description handshake(Ref) -> handshake(Ref, []) handshake(Ref, Opts) -> {ok, Socket} Ref :: ranch:ref() Opts :: any() Socket :: any() Perform the transport handshake. This function must be called by the protocol process in order to retrieve the socket for the connection. Ranch performs the handshake necessary to give control of the socket to this process and also does the transport handshake, for example setting up the TLS connection. ranch:handshake(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.handshake/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.handshake/ Name ranch:handshake - Perform the transport handshake Description handshake(Ref) -> handshake(Ref, []) handshake(Ref, Opts) -> {ok, Socket} Ref :: ranch:ref() Opts :: any() Socket :: any() Perform the transport handshake. This function must be called by the protocol process in order to retrieve the socket for the connection. Ranch performs the handshake necessary to give control of the socket to this process and also does the transport handshake, for example setting up the TLS connection. ranch:info(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.info/ Name ranch:info - Overview of Ranch listeners Description info() -> [{Ref, Info}] info(Ref) -> Info Info :: [{Key :: atom(), Value :: any()}] Overview of Ranch listeners. Arguments Ref The listener name. Return value Returns detailed information about one or all Ranch listeners. The following keys are returned: pid Pid of the listener's top-level supervisor. status Listener status, either running or suspended. ip Interface Ranch listens on. ranch:info(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.info/ Name ranch:info - Overview of Ranch listeners Description info() -> [{Ref, Info}] info(Ref) -> Info Info :: [{Key :: atom(), Value :: any()}] Overview of Ranch listeners. Arguments Ref The listener name. Return value Returns detailed information about one or all Ranch listeners. The following keys are returned: pid Pid of the listener's top-level supervisor. status Listener status, either running or suspended. ip Interface Ranch listens on. ranch:info(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.info/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.info/ Name ranch:info - Overview of Ranch listeners Description info() -> #{Ref := Info} info(Ref) -> Info Info :: #{Key :: atom() := Value :: any()} Overview of Ranch listeners. Arguments Ref The listener name. Return value Returns detailed information about one or all Ranch listeners. The following keys are returned: pid Pid of the listener's top-level supervisor. status Listener status, either running or suspended. ip Interface Ranch listens on. ranch:procs(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.procs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.procs/ Name ranch:procs - Retrieve pids from a listener Description procs(Ref :: ranch:ref(), Type :: acceptors | connections) -> Pids :: [pid()] Retrieve pids from a listener. Arguments Ref The listener name. Type The type of process that will be returned. Return value A list of pids is returned. Examples Get the pids of the acceptor processes Pids = ranch:procs(acceptors). Get the pids of the connection processes Pids = ranch:procs(connections). ranch:procs(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.procs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.procs/ Name ranch:procs - Retrieve pids from a listener Description procs(Ref :: ranch:ref(), Type :: acceptors | connections) -> Pids :: [pid()] Retrieve pids from a listener. Arguments Ref The listener name. Type The type of process that will be returned. Return value A list of pids is returned. Examples Get the pids of the acceptor processes Pids = ranch:procs(acceptors). Get the pids of the connection processes Pids = ranch:procs(connections). ranch:procs(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.procs/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.procs/ Name ranch:procs - Retrieve pids from a listener Description procs(Ref :: ranch:ref(), Type :: acceptors | connections) -> Pids :: [pid()] Retrieve pids from a listener. Arguments Ref The listener name. Type The type of process that will be returned. Return value A list of pids is returned. Examples Get the pids of the acceptor processes Pids = ranch:procs(acceptors). Get the pids of the connection processes Pids = ranch:procs(connections). ranch:recv_proxy_header(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.recv_proxy_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.recv_proxy_header/ Name ranch:recv_proxy_header - Receive the PROXY protocol header Description recv_proxy_header(ranch:ref(), timeout()) -> {ok, ranch_proxy_header:proxy_info()} | {error, Reason :: atom()} | {error, protocol_error, HumanReadable :: atom()} Receive the PROXY protocol header. This function must be called before ranch:handshake/1,2 on newly accepted connections to read and parse the PROXY protocol header, if any. Arguments Ref The listener name. Timeout Receive timeout in milliseconds. Return value An ok tuple is returned containing PROXY header information on success. ranch:recv_proxy_header(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.recv_proxy_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.recv_proxy_header/ Name ranch:recv_proxy_header - Receive the PROXY protocol header Description recv_proxy_header(ranch:ref(), timeout()) -> {ok, ranch_proxy_header:proxy_info()} | {error, Reason :: atom()} | {error, protocol_error, HumanReadable :: atom()} Receive the PROXY protocol header. This function must be called before ranch:handshake/1,2 on newly accepted connections to read and parse the PROXY protocol header, if any. Arguments Ref The listener name. Timeout Receive timeout in milliseconds. Return value An ok tuple is returned containing PROXY header information on success. ranch:remove_connection(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.remove_connection/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.remove_connection/ Name ranch:remove_connection - Remove connection from the count Description remove_connection(Ref :: ranch:ref()) -> ok Remove connection from the count. This connection will no longer be included in the count when limiting the number of connections. This can be useful in a mixed environment where some connections are active and others are passive. Passive connections spend most of their time idling and are not consuming much resources. This function may only be called from a connection process. ranch:remove_connection(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.remove_connection/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.remove_connection/ Name ranch:remove_connection - Remove connection from the count Description remove_connection(Ref :: ranch:ref()) -> ok Remove connection from the count. This connection will no longer be included in the count when limiting the number of connections. This can be useful in a mixed environment where some connections are active and others are passive. Passive connections spend most of their time idling and are not consuming much resources. This function may only be called from a connection process. ranch:remove_connection(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.remove_connection/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.remove_connection/ Name ranch:remove_connection - Remove connection from the count Description remove_connection(Ref :: ranch:ref()) -> ok Remove connection from the count. This connection will no longer be included in the count when limiting the number of connections. This can be useful in a mixed environment where some connections are active and others are passive. Passive connections spend most of their time idling and are not consuming much resources. This function may only be called from a connection process. ranch:resume_listener(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.resume_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.resume_listener/ Name ranch:resume_listener - Resume a suspended listener Description resume_listener(Ref :: ranch_ref()) -> ok | {error, any()} Resume a suspended listener. Ranch will start listening for and accepting connections again. The function ranch:set_transport_options(3) can be used to change the transport options before resuming the listener. Nothing is done when the listener is already running. Arguments Ref The listener name. Return value The atom ok is returned on success. ranch:resume_listener(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.resume_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.resume_listener/ Name ranch:resume_listener - Resume a suspended listener Description resume_listener(Ref :: ranch_ref()) -> ok | {error, any()} Resume a suspended listener. Ranch will start listening for and accepting connections again. The function ranch:set_transport_options(3) can be used to change the transport options before resuming the listener. Nothing is done when the listener is already running. Arguments Ref The listener name. Return value The atom ok is returned on success. ranch:resume_listener(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.resume_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.resume_listener/ Name ranch:resume_listener - Resume a suspended listener Description resume_listener(Ref :: ranch_ref()) -> ok | {error, any()} Resume a suspended listener. Ranch will start listening for and accepting connections again. The function ranch:set_transport_options(3) can be used to change the transport options before resuming the listener. Nothing is done when the listener is already running. Arguments Ref The listener name. Return value The atom ok is returned on success. ranch:set_max_connections(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_max_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_max_connections/ Name ranch:set_max_connections - Set the max number of connections Description set_max_connections(Ref :: ranch:ref(), MaxConns :: ranch:max_conns()) -> ok Set the max number of connections. The change will be applied immediately. If the new value is smaller than the previous one, Ranch will wait for the extra connections to terminate and will not accept new connections until the number of connections goes below the limit. Arguments Ref The listener name. ranch:set_max_connections(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_max_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_max_connections/ Name ranch:set_max_connections - Set the max number of connections Description set_max_connections(Ref :: ranch:ref(), MaxConns :: ranch:max_conns()) -> ok Set the max number of connections. The change will be applied immediately. If the new value is smaller than the previous one, Ranch will wait for the extra connections to terminate and will not accept new connections until the number of connections goes below the limit. Arguments Ref The listener name. ranch:set_max_connections(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.set_max_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.set_max_connections/ Name ranch:set_max_connections - Set the max number of connections per connection supervisor Description set_max_connections(Ref :: ranch:ref(), MaxConns :: ranch:max_conns()) -> ok Set the max number of connections per connection supervisor. The change will be applied immediately. If the new value is smaller than the previous one, Ranch will wait for the extra connections to terminate and will not accept new connections until the number of connections goes below the limit. ranch:set_protocol_options(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_protocol_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_protocol_options/ Name ranch:set_protocol_options - Set the protocol options Description set_protocol_options(Ref :: ranch:ref(), ProtoOpts :: any()) -> ok Set the protocol options. The change will be applied immediately for all new connections. Old connections will not receive the new options. Arguments Ref The listener name. ProtoOpts The new protocol options. Return value The atom ok is always returned. It can be safely ignored. Examples Set the protocol options ranch:set_protocol_options(example, ProtoOpts). ranch:set_protocol_options(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_protocol_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_protocol_options/ Name ranch:set_protocol_options - Set the protocol options Description set_protocol_options(Ref :: ranch:ref(), ProtoOpts :: any()) -> ok Set the protocol options. The change will be applied immediately for all new connections. Old connections will not receive the new options. Arguments Ref The listener name. ProtoOpts The new protocol options. Return value The atom ok is always returned. It can be safely ignored. Examples Set the protocol options ranch:set_protocol_options(example, ProtoOpts). ranch:set_protocol_options(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.set_protocol_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.set_protocol_options/ Name ranch:set_protocol_options - Set the protocol options Description set_protocol_options(Ref :: ranch:ref(), ProtoOpts :: any()) -> ok Set the protocol options. The change will be applied immediately for all new connections. Old connections will not receive the new options. Arguments Ref The listener name. ProtoOpts The new protocol options. Return value The atom ok is always returned. It can be safely ignored. Examples Set the protocol options ranch:set_protocol_options(example, ProtoOpts). ranch:set_transport_options(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_transport_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.set_transport_options/ Name ranch:set_transport_options - Set the transport options Description set_transport_options(Ref :: ranch:ref(), TransOpts :: any()) -> ok | {error, running} Set the transport options. The listener must be suspended for this call to succeed. If the listener is running, {error, running} will be returned. The change will take effect when the listener resumes. Arguments Ref The listener name. TransOpts The new transport options. Return value The atom ok is always returned. ranch:set_transport_options(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_transport_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.set_transport_options/ Name ranch:set_transport_options - Set the transport options Description set_transport_options(Ref :: ranch:ref(), TransOpts :: any()) -> ok | {error, running} Set the transport options. The listener must be suspended for this call to succeed. If the listener is running, {error, running} will be returned. The change will take effect when the listener resumes. Arguments Ref The listener name. TransOpts The new transport options. Return value The atom ok is always returned. ranch:set_transport_options(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.set_transport_options/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.set_transport_options/ Name ranch:set_transport_options - Set the transport options Description set_transport_options(Ref :: ranch:ref(), TransOpts :: ranch:opts()) -> ok | {error, Reason :: term()} Set the transport options. Changes to the following options will take effect... immediately: max_connections handshake_timeout shutdown only after the listener has been suspended and resumed: num_acceptors num_listen_sockets socket_opts only when the entire listener is restarted: connection_type num_conns_sups logger Arguments Ref The listener name. ranch:start_listener(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.start_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.start_listener/ Name ranch:start_listener - Start a listener Description start_listener(Ref :: ranch_ref(), Transport :: module(), TransOpts :: ranch:opts(), Protocol :: module(), ProtoOpts :: any()) -> {ok, ListenerPid :: pid()} | {error, any()} Start a listener. A listener is a set of processes that accepts and manages connections using the given transport and protocol modules. Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. ranch:start_listener(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.start_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.start_listener/ Name ranch:start_listener - Start a listener Description start_listener(Ref :: ranch_ref(), Transport :: module(), TransOpts :: ranch:opts(), Protocol :: module(), ProtoOpts :: any()) -> {ok, ListenerPid :: pid()} | {error, any()} Start a listener. A listener is a set of processes that accepts and manages connections using the given transport and protocol modules. Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. ranch:start_listener(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.start_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.start_listener/ Name ranch:start_listener - Start a listener Description start_listener(Ref :: ranch_ref(), Transport :: module(), TransOpts :: ranch:opts(), Protocol :: module(), ProtoOpts :: any()) -> {ok, ListenerPid :: pid()} | {error, any()} Start a listener. A listener is a set of processes that accepts and manages connections using the given transport and protocol modules. Arguments Ref The listener name is used to refer to this listener in future calls, for example when stopping it or when updating the configuration. ranch:stop_listener(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.stop_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.stop_listener/ Name ranch:stop_listener - Stop a listener Description stop_listener(Ref :: ranch_ref()) -> ok | {error, not_found} Stop a listener. The listener is stopped gracefully, first by closing the listening port, then by stopping the connection processes. These processes are stopped according to the shutdown transport option, which may be set to brutally kill all connection processes or give them some time to stop properly. In order for the connection processes to exit gracefully, they need to trap exit signals and stop before the configured shutdown timeout. ranch:stop_listener(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.stop_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.stop_listener/ Name ranch:stop_listener - Stop a listener Description stop_listener(Ref :: ranch_ref()) -> ok | {error, not_found} Stop a listener. The listener is stopped gracefully, first by closing the listening port, then by stopping the connection processes. These processes are stopped according to the shutdown transport option, which may be set to brutally kill all connection processes or give them some time to stop properly. In order for the connection processes to exit gracefully, they need to trap exit signals and stop before the configured shutdown timeout. ranch:stop_listener(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.stop_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.stop_listener/ Name ranch:stop_listener - Stop a listener Description stop_listener(Ref :: ranch_ref()) -> ok | {error, not_found} Stop a listener. The listener is stopped gracefully, first by closing the listening port, then by stopping the connection processes. These processes are stopped according to the shutdown transport option, which may be set to brutally kill all connection processes or give them some time to stop properly. In order for the connection processes to exit gracefully, they need to trap exit signals and stop before the configured shutdown timeout. ranch:suspend_listener(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.suspend_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.suspend_listener/ Name ranch:suspend_listener - Suspend a running listener Description suspend_listener(Ref :: ranch_ref()) -> ok | {error, any()} Suspend a running listener. Ranch will stop listening for and accepting connections and the listening socket will be closed. Existing connections will continue undisturbed. The function ranch:wait_for_connections(3) can be used to wait for connections to be closed if necessary. Some transport options can only be changed when the listener is suspended. Please consult the ranch:set_transport_options(3) manual for more information. ranch:suspend_listener(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.suspend_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.suspend_listener/ Name ranch:suspend_listener - Suspend a running listener Description suspend_listener(Ref :: ranch_ref()) -> ok | {error, any()} Suspend a running listener. Ranch will stop listening for and accepting connections and the listening socket will be closed. Existing connections will continue undisturbed. The function ranch:wait_for_connections(3) can be used to wait for connections to be closed if necessary. Some transport options can only be changed when the listener is suspended. Please consult the ranch:set_transport_options(3) manual for more information. ranch:suspend_listener(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.suspend_listener/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.suspend_listener/ Name ranch:suspend_listener - Suspend a running listener Description suspend_listener(Ref :: ranch_ref()) -> ok | {error, any()} Suspend a running listener. Ranch will stop listening for and accepting connections and the listening socket will be closed. Existing connections will continue undisturbed. The function ranch:wait_for_connections(3) can be used to wait for connections to be closed if necessary. Some transport options can only be changed when the listener is suspended. Please consult the ranch:set_transport_options(3) manual for more information. ranch:wait_for_connections(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.wait_for_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch.wait_for_connections/ Name ranch:wait_for_connections - Wait for a specific number of connections Description wait_for_connections(Ref :: ranch:ref(), Operator, NumConns :: non_neg_integer()) -> ok Operator :: '>' | '>=' | '==' | '=<' | '<' Wait for a specific number of connections. This function waits until the number of connections on the given listener becomes higher than, equal to or lower than the given number. It never returns otherwise. This function can be used to gracefully shutdown a listener by first suspending the listener and then waiting for connections to terminate before finally stopping the listener. ranch:wait_for_connections(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.wait_for_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch.wait_for_connections/ Name ranch:wait_for_connections - Wait for a specific number of connections Description wait_for_connections(Ref :: ranch:ref(), Operator, NumConns :: non_neg_integer()) -> ok Operator :: '>' | '>=' | '==' | '=<' | '<' Wait for a specific number of connections. This function waits until the number of connections on the given listener becomes higher than, equal to or lower than the given number. It never returns otherwise. This function can be used to gracefully shutdown a listener by first suspending the listener and then waiting for connections to terminate before finally stopping the listener. ranch:wait_for_connections(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.wait_for_connections/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch.wait_for_connections/ Name ranch:wait_for_connections - Wait for a specific number of connections Description wait_for_connections(Ref :: ranch:ref(), Operator, NumConns :: non_neg_integer()) -> ok Operator :: '>' | '>=' | '==' | '=<' | '<' Wait for a specific number of connections. This function waits until the number of connections on the given listener becomes higher than, equal to or lower than the given number. It never returns otherwise. This function can be used to gracefully shutdown a listener by first suspending the listener and then waiting for connections to terminate before finally stopping the listener. ranch_protocol(3) https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_protocol/ Name ranch_protocol - behaviour for protocol modules Description The ranch_protocol behaviour defines the interface used by Ranch protocols. Types None. Callbacks start_link(Ref, Socket, Transport, ProtoOpts) -> {ok, pid()} | {ok, pid(), pid()} Ref = ranch:ref() Listener name. Socket = any() Socket for this connection. Transport = module() Transport module for this socket. ProtoOpts = any() Protocol options. Start a new connection process for the given socket. ranch_protocol(3) https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_protocol/ Name ranch_protocol - behaviour for protocol modules Description The ranch_protocol behaviour defines the interface used by Ranch protocols. Types None. Callbacks start_link(Ref, Socket, Transport, ProtoOpts) -> {ok, pid()} | {ok, pid(), pid()} Ref = ranch:ref() Listener name. Socket = any() Socket for this connection. Transport = module() Transport module for this socket. ProtoOpts = any() Protocol options. Start a new connection process for the given socket. ranch_protocol(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_protocol/ Name ranch_protocol - Protocol modules Description The module ranch_protocol defines the interface used by Ranch protocols. Callbacks Ranch protocols implement the following interface: start_link(Ref :: ranch:ref(), _, Transport :: module(), ProtoOpts :: any()) -> {ok, ConnPid :: pid()} | {ok, SupPid :: pid(), ConnPid :: pid()} Start a new connection process. The only purpose of this callback is to start a process that will handle the socket. It must spawn the process, link and then return the new pid. ranch_protocol(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_protocol/ Name ranch_protocol - Protocol modules Description The module ranch_protocol defines the interface used by Ranch protocols. Callbacks Ranch protocols implement the following interface: start_link(Ref :: ranch:ref(), _, Transport :: module(), ProtoOpts :: any()) -> {ok, ConnPid :: pid()} | {ok, SupPid :: pid(), ConnPid :: pid()} Start a new connection process. The only purpose of this callback is to start a process that will handle the socket. It must spawn the process, link and then return the new pid. ranch_protocol(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_protocol/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_protocol/ Name ranch_protocol - Protocol modules Description The module ranch_protocol defines the interface used by Ranch protocols. Callbacks Ranch protocols implement the following interface: start_link(Ref :: ranch:ref(), Transport :: module(), ProtoOpts :: any()) -> {ok, ConnPid :: pid()} | {ok, SupPid :: pid(), ConnPid :: pid()} Start a new connection process. The only purpose of this callback is to start a process that will handle the socket. It must spawn the process, link and then return the new pid. ranch_proxy_header(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header/ Name ranch_proxy_header - PROXY protocol Description The module ranch_proxy_header provides functions for parsing and building the PROXY protocol header. Exports ranch_proxy_header:parse(3) - Parse a PROXY protocol header ranch_proxy_header:header(3) - Build a PROXY protocol header Types proxy_info() proxy_info() = #{ %% Mandatory part. version := 1 | 2, command := local | proxy, transport_family => undefined | ipv4 | ipv6 | unix, transport_protocol => undefined | stream | dgram, %% Addresses. ranch_proxy_header(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_proxy_header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_proxy_header/ Name ranch_proxy_header - PROXY protocol Description The module ranch_proxy_header provides functions for parsing and building the PROXY protocol header. Exports ranch_proxy_header:parse(3) - Parse a PROXY protocol header ranch_proxy_header:header(3) - Build a PROXY protocol header Types proxy_info() proxy_info() = #{ %% Mandatory part. version := 1 | 2, command := local | proxy, transport_family => undefined | ipv4 | ipv6 | unix, transport_protocol => undefined | stream | dgram, %% Addresses. ranch_proxy_header:header(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header.header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header.header/ Name ranch_proxy_header:header - Build a PROXY protocol header Description header(ProxyInfo) -> header(ProxyInfo, #{}) header(ProxyInfo, BuildOpts) -> iodata() ProxyInfo :: ranch_proxy_header:proxy_info() BuildOpts :: #{ checksum => crc32c, padding => pos_integer() %% >= 3 } Build a PROXY protocol header. Arguments ProxyInfo The proxy information to encode. BuildOpts Options to control whether to add a checksum or padding should be included in the encoded PROXY protocol header. Return value The PROXY protocol header is returned. ranch_proxy_header:header(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_proxy_header.header/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_proxy_header.header/ Name ranch_proxy_header:header - Build a PROXY protocol header Description header(ProxyInfo) -> header(ProxyInfo, #{}) header(ProxyInfo, BuildOpts) -> iodata() ProxyInfo :: ranch_proxy_header:proxy_info() BuildOpts :: #{ checksum => crc32c, padding => pos_integer() %% >= 3 } Build a PROXY protocol header. Arguments ProxyInfo The proxy information to encode. BuildOpts Options to control whether to add a checksum or padding should be included in the encoded PROXY protocol header. Return value The PROXY protocol header is returned. ranch_proxy_header:parse(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header.parse/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_proxy_header.parse/ Name ranch_proxy_header:parse - Parse a PROXY protocol header Description parse(Data :: binary()) -> {ok, ranch_proxy_header:proxy_info(), Rest :: binary()} | {error, HumanReadable :: atom()} Parse a PROXY protocol header. Arguments Data The PROXY protocol header optionally followed by more data. Return value An ok tuple is returned on success, containing the proxy information found in the header and the rest of the data if more was provided. An error tuple is returned when a protocol error is detected. ranch_proxy_header:parse(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_proxy_header.parse/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_proxy_header.parse/ Name ranch_proxy_header:parse - Parse a PROXY protocol header Description parse(Data :: binary()) -> {ok, ranch_proxy_header:proxy_info(), Rest :: binary()} | {error, HumanReadable :: atom()} Parse a PROXY protocol header. Arguments Data The PROXY protocol header optionally followed by more data. Return value An ok tuple is returned on success, containing the proxy information found in the header and the rest of the data if more was provided. An error tuple is returned when a protocol error is detected. ranch_ssl(3) https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_ssl/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_ssl/ Name ranch_ssl - SSL transport module Description The ranch_ssl module implements an SSL Ranch transport. Types ssl_opt() ssl_opt() = {alpn_preferred_protocols, [binary()]} | {beast_mitigation, one_n_minus_one | zero_n | disabled} | {cacertfile, string()} | {cacerts, [public_key:der_encoded()]} | {cert, public_key:der_encoded()} | {certfile, string()} | {ciphers, [ssl:erl_cipher_suite()] | string()} | {client_renegotiation, boolean()} | {crl_cache, {module(), {internal | any(), list()}}} | {crl_check, boolean() | peer | best_effort} | {depth, 0..255} | {dh, public_key:der_encoded()} | {dhfile, string()} | {fail_if_no_peer_cert, boolean()} | {hibernate_after, integer() | undefined} | {honor_cipher_order, boolean()} | {key, {'RSAPrivateKey' | 'DSAPrivateKey' | 'PrivateKeyInfo', public_key:der_encoded()}} | {keyfile, string()} | {log_alert, boolean()} | {next_protocols_advertised, [binary()]} | {padding_check, boolean()} | {partial_chain, fun(([public_key:der_encoded()]) -> {trusted_ca, public_key:der_encoded()} | unknown_ca)} | {password, string()} | {psk_identity, string()} | {reuse_session, fun()} | {reuse_sessions, boolean()} | {secure_renegotiate, boolean()} | {signature_algs, [{atom(), atom()}]} | {sni_fun, fun()} | {sni_hosts, [{string(), ssl_opt()}]} | {user_lookup_fun, {fun(), any()}} | {v2_hello_compatible, boolean()} | {verify, ssl:verify_type()} | {verify_fun, {fun(), any()}} | {versions, [atom()]}. ranch_ssl(3) https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_ssl/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_ssl/ Name ranch_ssl - SSL transport module Description The ranch_ssl module implements an SSL Ranch transport. Types ssl_opt() ssl_opt() = {alpn_preferred_protocols, [binary()]} | {beast_mitigation, one_n_minus_one | zero_n | disabled} | {cacertfile, string()} | {cacerts, [public_key:der_encoded()]} | {cert, public_key:der_encoded()} | {certfile, string()} | {ciphers, [ssl:erl_cipher_suite()] | string()} | {client_renegotiation, boolean()} | {crl_cache, {module(), {internal | any(), list()}}} | {crl_check, boolean() | peer | best_effort} | {depth, 0..255} | {dh, public_key:der_encoded()} | {dhfile, string()} | {fail_if_no_peer_cert, boolean()} | {hibernate_after, integer() | undefined} | {honor_cipher_order, boolean()} | {key, {'RSAPrivateKey' | 'DSAPrivateKey' | 'PrivateKeyInfo', public_key:der_encoded()}} | {keyfile, string()} | {log_alert, boolean()} | {next_protocols_advertised, [binary()]} | {padding_check, boolean()} | {partial_chain, fun(([public_key:der_encoded()]) -> {trusted_ca, public_key:der_encoded()} | unknown_ca)} | {password, string()} | {psk_identity, string()} | {reuse_session, fun()} | {reuse_sessions, boolean()} | {secure_renegotiate, boolean()} | {signature_algs, [{atom(), atom()}]} | {sni_fun, fun()} | {sni_hosts, [{string(), ssl_opt()}]} | {user_lookup_fun, {fun(), any()}} | {v2_hello_compatible, boolean()} | {verify, ssl:verify_type()} | {verify_fun, {fun(), any()}} | {versions, [atom()]}. ranch_ssl(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_ssl/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_ssl/ Name ranch_ssl - SSL transport Description The module ranch_ssl implements an SSL Ranch transport. Exports The module ranch_ssl implements the interface defined by ranch_transport(3). Types opt() opt() :: ranch_tcp:opt() | ssl_opt() Listen options. The TCP options are defined in ranch_tcp(3). opts() opts() :: [opt()] List of listen options. ssl_opt() ssl_opt() = {alpn_preferred_protocols, [binary()]} | {beast_mitigation, one_n_minus_one | zero_n | disabled} | {cacertfile, string()} | {cacerts, [public_key:der_encoded()]} | {cert, public_key:der_encoded()} | {certfile, string()} | {ciphers, [ssl:erl_cipher_suite()] | string()} | {client_renegotiation, boolean()} | {crl_cache, {module(), {internal | any(), list()}}} | {crl_check, boolean() | peer | best_effort} | {depth, 0. ranch_ssl(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_ssl/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_ssl/ Name ranch_ssl - SSL transport Description The module ranch_ssl implements an SSL Ranch transport. Exports The module ranch_ssl implements the interface defined by ranch_transport(3). Types opt() opt() :: ranch_tcp:opt() | ssl_opt() Listen options. The TCP options are defined in ranch_tcp(3). opts() opts() :: [opt()] List of listen options. ssl_opt() ssl_opt() = {alpn_preferred_protocols, [binary()]} | {beast_mitigation, one_n_minus_one | zero_n | disabled} | {cacertfile, string()} | {cacerts, [public_key:der_encoded()]} | {cert, public_key:der_encoded()} | {certfile, string()} | {ciphers, [ssl:erl_cipher_suite()] | string()} | {client_renegotiation, boolean()} | {crl_cache, {module(), {internal | any(), list()}}} | {crl_check, boolean() | peer | best_effort} | {depth, 0. ranch_ssl(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_ssl/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_ssl/ Name ranch_ssl - SSL transport Description The module ranch_ssl implements an SSL Ranch transport. Exports The module ranch_ssl implements the interface defined by ranch_transport(3). Types opt() opt() :: ranch_tcp:opt() | ssl_opt() Listen options. The TCP options are defined in ranch_tcp(3). opts() opts() :: [opt()] List of listen options. ssl_opt() ssl_opt() = {alpn_preferred_protocols, [binary()]} | {beast_mitigation, one_n_minus_one | zero_n | disabled} | {cacertfile, file:filename()} | {cacerts, [public_key:der_encoded()]} | {cert, public_key:der_encoded()} | {certfile, file:filename()} | {ciphers, ssl:ciphers()} | {client_renegotiation, boolean()} | {crl_cache, [any()]} | {crl_check, boolean() | peer | best_effort} | {depth, integer()} | {dh, binary()} | {dhfile, file:filename()} | {eccs, [atom()]} | {fail_if_no_peer_cert, boolean()} | {hibernate_after, timeout()} | {honor_cipher_order, boolean()} | {honor_ecc_order, boolean()} | {key, ssl:key()} | {keyfile, file:filename()} | {log_alert, boolean()} | {log_level, logger:level()} | {max_handshake_size, integer()} | {next_protocols_advertised, [binary()]} | {padding_check, boolean()} | {partial_chain, fun()} | {password, string()} | {protocol, tls | dtls} | {psk_identity, string()} | {reuse_session, fun()} | {reuse_sessions, boolean()} | {secure_renegotiate, boolean()} | {signature_algs, [{ssl:hash(), ssl:sign_algo()}]} | {signature_algs_cert, [atom()]} | {sni_fun, fun()} | {sni_hosts, [{string(), ssl_opt()}]} | {user_lookup_fun, {fun(), any()}} | {verify, verify_none | verify_peer} | {verify_fun, {fun(), any()}} | {versions, [ssl:protocol_version()]} SSL-specific listen options. ranch_tcp(3) https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_tcp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_tcp/ Name ranch_tcp - TCP transport module Description The ranch_tcp module implements a TCP Ranch transport. Note that due to bugs in OTP up to at least R16B02, it is recommended to disable async threads when using the sendfile function of this transport, as it can make the threads stuck indefinitely. Types opt() opt() = {backlog, non_neg_integer()} | {buffer, non_neg_integer()} | {delay_send, boolean()} | {dontroute, boolean()} | {exit_on_close, boolean()} | {fd, non_neg_integer()} | {high_msgq_watermark, non_neg_integer()} | {high_watermark, non_neg_integer()} | inet | inet6 | {ip, inet:ip_address()} | {ipv6_v6only, boolean()} | {keepalive, boolean()} | {linger, {boolean(), non_neg_integer()}} | {low_msgq_watermark, non_neg_integer()} | {low_watermark, non_neg_integer()} | {nodelay, boolean()} | {port, inet:port_number()} | {priority, integer()} | {raw, non_neg_integer(), non_neg_integer(), binary()} | {recbuf, non_neg_integer()} | {send_timeout, timeout()} | {send_timeout_close, boolean()} | {sndbuf, non_neg_integer()} | {tos, integer()} Listen options. ranch_tcp(3) https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_tcp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_tcp/ Name ranch_tcp - TCP transport module Description The ranch_tcp module implements a TCP Ranch transport. Note that due to bugs in OTP up to at least R16B02, it is recommended to disable async threads when using the sendfile function of this transport, as it can make the threads stuck indefinitely. Types opt() opt() = {backlog, non_neg_integer()} | {buffer, non_neg_integer()} | {delay_send, boolean()} | {dontroute, boolean()} | {exit_on_close, boolean()} | {fd, non_neg_integer()} | {high_msgq_watermark, non_neg_integer()} | {high_watermark, non_neg_integer()} | inet | inet6 | {ip, inet:ip_address()} | {ipv6_v6only, boolean()} | {keepalive, boolean()} | {linger, {boolean(), non_neg_integer()}} | {low_msgq_watermark, non_neg_integer()} | {low_watermark, non_neg_integer()} | {nodelay, boolean()} | {port, inet:port_number()} | {priority, integer()} | {raw, non_neg_integer(), non_neg_integer(), binary()} | {recbuf, non_neg_integer()} | {send_timeout, timeout()} | {send_timeout_close, boolean()} | {sndbuf, non_neg_integer()} | {tos, integer()} Listen options. ranch_tcp(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_tcp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_tcp/ Name ranch_tcp - TCP transport Description The module ranch_tcp implements a TCP Ranch transport. The function sendfile may not work correctly when used against files stored in a VirtualBox shared folder. Exports The module ranch_tcp implements the interface defined by ranch_transport(3). Types opt() opt() = {backlog, non_neg_integer()} | {buffer, non_neg_integer()} | {delay_send, boolean()} | {dontroute, boolean()} | {exit_on_close, boolean()} | {fd, non_neg_integer()} | {high_msgq_watermark, non_neg_integer()} | {high_watermark, non_neg_integer()} | inet | inet6 | {ip, inet:ip_address()} | {ipv6_v6only, boolean()} | {keepalive, boolean()} | {linger, {boolean(), non_neg_integer()}} | {low_msgq_watermark, non_neg_integer()} | {low_watermark, non_neg_integer()} | {nodelay, boolean()} | {port, inet:port_number()} | {priority, integer()} | {raw, non_neg_integer(), non_neg_integer(), binary()} | {recbuf, non_neg_integer()} | {send_timeout, timeout()} | {send_timeout_close, boolean()} | {sndbuf, non_neg_integer()} | {tos, integer()} Listen options. ranch_tcp(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_tcp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_tcp/ Name ranch_tcp - TCP transport Description The module ranch_tcp implements a TCP Ranch transport. The function sendfile may not work correctly when used against files stored in a VirtualBox shared folder. Exports The module ranch_tcp implements the interface defined by ranch_transport(3). Types opt() opt() = {backlog, non_neg_integer()} | {buffer, non_neg_integer()} | {delay_send, boolean()} | {dontroute, boolean()} | {exit_on_close, boolean()} | {fd, non_neg_integer()} | {high_msgq_watermark, non_neg_integer()} | {high_watermark, non_neg_integer()} | inet | inet6 | {ip, inet:ip_address()} | {ipv6_v6only, boolean()} | {keepalive, boolean()} | {linger, {boolean(), non_neg_integer()}} | {low_msgq_watermark, non_neg_integer()} | {low_watermark, non_neg_integer()} | {nodelay, boolean()} | {port, inet:port_number()} | {priority, integer()} | {raw, non_neg_integer(), non_neg_integer(), binary()} | {recbuf, non_neg_integer()} | {send_timeout, timeout()} | {send_timeout_close, boolean()} | {sndbuf, non_neg_integer()} | {tos, integer()} Listen options. ranch_tcp(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_tcp/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_tcp/ Name ranch_tcp - TCP transport Description The module ranch_tcp implements a TCP Ranch transport. The function sendfile may not work correctly when used against files stored in a VirtualBox shared folder. Exports The module ranch_tcp implements the interface defined by ranch_transport(3). Types opt() opt() = {backlog, non_neg_integer()} | {buffer, non_neg_integer()} | {delay_send, boolean()} | {dontroute, boolean()} | {exit_on_close, boolean()} | {fd, non_neg_integer()} | {high_msgq_watermark, non_neg_integer()} | {high_watermark, non_neg_integer()} | inet | inet6 | {ip, inet:ip_address() | inet:local_address()} | {ipv6_v6only, boolean()} | {keepalive, boolean()} | {linger, {boolean(), non_neg_integer()}} | {low_msgq_watermark, non_neg_integer()} | {low_watermark, non_neg_integer()} | {nodelay, boolean()} | {port, inet:port_number()} | {priority, integer()} | {raw, non_neg_integer(), non_neg_integer(), binary()} | {recbuf, non_neg_integer()} | {send_timeout, timeout()} | {send_timeout_close, boolean()} | {sndbuf, non_neg_integer()} | {tos, integer()} Listen options. ranch_transport(3) https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_transport/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.4/manual/ranch_transport/ Name ranch_transport - behaviour for transport modules Description The ranch_transport behaviour defines the interface used by Ranch transports. Types sendfile_opts() = [{chunk_size, non_neg_integer()}] Options used by the sendfile function and callbacks. Allows configuring the chunk size, in bytes. Defaults to 8191 bytes. Callbacks accept(LSocket, Timeout) -> {ok, CSocket} | {error, closed | timeout | atom()} LSocket = CSocket = any() Listening socket. Timeout = timeout() Accept timeout. Accept a connection on the given listening socket. ranch_transport(3) https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_transport/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.5/manual/ranch_transport/ Name ranch_transport - behaviour for transport modules Description The ranch_transport behaviour defines the interface used by Ranch transports. Types sendfile_opts() = [{chunk_size, non_neg_integer()}] Options used by the sendfile function and callbacks. Allows configuring the chunk size, in bytes. Defaults to 8191 bytes. Callbacks accept(LSocket, Timeout) -> {ok, CSocket} | {error, closed | timeout | atom()} LSocket = CSocket = any() Listening socket. Timeout = timeout() Accept timeout. Accept a connection on the given listening socket. ranch_transport(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_transport/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_transport/ Name ranch_transport - Transport modules Description The module ranch_transport defines the interface used by Ranch transports. Callbacks Ranch transports implement the following interface: accept accept(LSocket :: socket(), Timeout :: timeout()) -> {ok, Socket :: socket()} | {error, closed | timeout | atom()} Use the listening socket returned by listen/1 to accept a new connection. The timeout is specified in milliseconds. close close(Socket :: socket()) -> ok Close the socket. ranch_transport(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_transport/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_transport/ Name ranch_transport - Transport modules Description The module ranch_transport defines the interface used by Ranch transports. Callbacks Ranch transports implement the following interface: accept accept(LSocket :: socket(), Timeout :: timeout()) -> {ok, Socket :: socket()} | {error, closed | timeout | atom()} Use the listening socket returned by listen/1 to accept a new connection. The timeout is specified in milliseconds. close close(Socket :: socket()) -> ok Close the socket. ranch_transport(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_transport/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_transport/ Name ranch_transport - Transport modules Description The module ranch_transport defines the interface used by Ranch transports. Callbacks Ranch transports implement the following interface: accept accept(LSocket :: socket(), Timeout :: timeout()) -> {ok, Socket :: socket()} | {error, closed | timeout | atom()} Use the listening socket returned by listen/1 to accept a new connection. The timeout is specified in milliseconds. close close(Socket :: socket()) -> ok Close the socket. ranch_transport:sendfile(3) https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_transport.sendfile/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.6/manual/ranch_transport.sendfile/ Name ranch_transport:sendfile - Send a file on the socket Description sendfile(Transport :: module(), Socket :: ranch_transport:socket(), File :: file:name_all() | file:fd(), Offset :: non_neg_integer(), Bytes :: non_neg_integer(), Opts :: ranch_transport:sendfile_opts()) -> {ok, SentBytes :: non_neg_integer()} | {error, atom()} Send a file on the socket. The file may be sent full or in parts, and may be specified by its filename or by an already open file descriptor. This function emulates the function file:sendfile/2,4,5 and may be used when transports are not manipulating TCP directly. ranch_transport:sendfile(3) https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_transport.sendfile/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/1.7/manual/ranch_transport.sendfile/ Name ranch_transport:sendfile - Send a file on the socket Description sendfile(Transport :: module(), Socket :: ranch_transport:socket(), File :: file:name_all() | file:fd(), Offset :: non_neg_integer(), Bytes :: non_neg_integer(), Opts :: ranch_transport:sendfile_opts()) -> {ok, SentBytes :: non_neg_integer()} | {error, atom()} Send a file on the socket. The file may be sent full or in parts, and may be specified by its filename or by an already open file descriptor. This function emulates the function file:sendfile/2,4,5 and may be used when transports are not manipulating TCP directly. ranch_transport:sendfile(3) https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_transport.sendfile/ Mon, 01 Jan 0001 00:00:00 +0000 https://ninenines.eu/docs/en/ranch/2.0/manual/ranch_transport.sendfile/ Name ranch_transport:sendfile - Send a file on the socket Description sendfile(Transport :: module(), Socket :: ranch_transport:socket(), File :: file:name_all() | file:fd(), Offset :: non_neg_integer(), Bytes :: non_neg_integer(), Opts :: ranch_transport:sendfile_opts()) -> {ok, SentBytes :: non_neg_integer()} | {error, atom()} Send a file on the socket. The file may be sent full or in parts, and may be specified by its filename or by an already open file descriptor. This function emulates the function file:sendfile/2,4,5 and may be used when transports are not manipulating TCP directly.