Skip to content

Limitations

Gluegun is an interface to Erlang Gun. It is not available on the JavaScript target.

Gun process ownership is important. Requests and WebSocket frames are asynchronous messages. Gun sends them to the process that owns, or waits for, the Gun stream, unless request options send replies to a different process. The high-level client functions read those messages on the calling process during send, then return. They do not start a separate consumer process.

Use connection.close to stop a connection through Gun's supervisor. It waits for process exit, but does not drain HTTP streams or flush your mailbox. connection.shutdown requests graceful shutdown without waiting; it cannot interrupt blocked setup. Use connection.terminate for deadline cleanup: it forces exit, waits, then flushes the caller's Gun messages. See Message Flow.

Finite initial flow credit counts data messages. Gun and OTP can allocate socket buffers or parse several frames before flow control pauses reads or window updates. Check actual bytes before retaining data; do not treat credit as a strict memory cap. See Streaming.

High-level client functions collect bodies in memory

Section titled “High-level client functions collect bodies in memory”

Use the low-level request and message APIs for streams or advanced Gun flows. The client functions are for usual HTTP responses that can be collected in memory.

Gun supports WebSocket over HTTP/1.1. websocket.upgrade_with_protocol checks the protocol that connection.await_up returns. It rejects HTTP/2 before it calls Gun.

Advanced TLS options can require new typed additions in the future.

Check the current public API in the API reference before you use Gun options directly.