{"id":13836062,"url":"https://github.com/kaltura/nginx-srt-module","last_synced_at":"2025-07-10T13:31:33.968Z","repository":{"id":42189764,"uuid":"421418866","full_name":"kaltura/nginx-srt-module","owner":"kaltura","description":"Nginx SRT/TCP gateway","archived":false,"fork":false,"pushed_at":"2024-02-05T12:20:48.000Z","size":111,"stargazers_count":93,"open_issues_count":9,"forks_count":15,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-06-08T15:08:02.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kaltura.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-26T12:38:27.000Z","updated_at":"2025-06-03T07:42:08.000Z","dependencies_parsed_at":"2024-01-13T16:44:45.479Z","dependency_job_id":"be13573d-228a-4519-8475-598365547bd9","html_url":"https://github.com/kaltura/nginx-srt-module","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/kaltura/nginx-srt-module","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fnginx-srt-module","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fnginx-srt-module/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fnginx-srt-module/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fnginx-srt-module/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kaltura","download_url":"https://codeload.github.com/kaltura/nginx-srt-module/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kaltura%2Fnginx-srt-module/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264585372,"owners_count":23632646,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T15:00:34.509Z","updated_at":"2025-07-10T13:31:33.608Z","avatar_url":"https://github.com/kaltura.png","language":"C","funding_links":[],"categories":["C","Streaming, media and image processing"],"sub_categories":[],"readme":"# Nginx SRT Module\n\nHaivision SRT (Secure Reliable Transfer) / TCP gateway.\nSupports both SRT to TCP and TCP to SRT, including bidirectional data transfer.\n\nThe implementation uses libsrt for SRT communication.\nThe libsrt code executes on a side thread, eventfd notifications are used in order to communicate\nwith the main nginx thread.\n\n## Build\n\n![Build Status](https://github.com/kaltura/nginx-srt-module/actions/workflows/ci.yml/badge.svg)\n\nTo link statically against nginx, cd to nginx source directory and execute:\n\n    ./configure --add-module=/path/to/nginx-srt-module --with-stream --with-threads\n\nTo compile as a dynamic module (nginx 1.9.11+), use:\n\n    ./configure --add-dynamic-module=/path/to/nginx-srt-module --with-stream --with-threads\n\nIn this case, the `load_module` directive should be used in nginx.conf to load the module.\n\n## Configuration\n\n### Sample configuration\n\n```\n# SRT -\u003e TCP proxy\nsrt {\n    server {\n        listen 4321;\n        proxy_pass tcp://127.0.0.1:5678;\n    }\n}\n\n# TCP -\u003e SRT proxy\nstream {\n    server {\n        listen 5432;\n        srt_proxy_pass srt://127.0.0.1:4321;\n    }\n}\n```\n\n### srt core directives\n\n#### srt\n* **syntax**: `srt { ... }`\n* **default**: `-`\n* **context**: `main`\n\nProvides the configuration file context in which the srt `server` directives are specified.\n\n#### server\n* **syntax**: `server { ... }`\n* **default**: `-`\n* **context**: `srt`\n\nSets the configuration for a server.\n\n#### listen\n* **syntax**: `listen address:port [backlog=number] [bind] [ipv6only=on|off] [reuseport];`\n* **default**: `-`\n* **context**: `server`\n\nSets the address and port for the UDP socket on which the server will accept connections.\n\nSee the documentation of the `listen` directive of the nginx `stream` module for more details on the optional parameters supported by this directive.\n\n#### variables_hash_max_size\n* **syntax**: `variables_hash_max_size size;`\n* **default**: `1024`\n* **context**: `srt`\n\nSets the maximum size of the variables hash table.\n\n#### variables_hash_bucket_size\n* **syntax**: `variables_hash_bucket_size size;`\n* **default**: `64`\n* **context**: `srt`\n\nSets the bucket size for the variables hash table.\n\n#### error_log\n* **syntax**: `error_log file [level];`\n* **default**: `logs/error.log error`\n* **context**: `srt, server`\n\nConfigures logging, see the documentation of the nginx core `error_log` directive for more details.\n\n#### fc_pkts\n* **syntax**: `fc_pkts number;`\n* **default**: `25600`\n* **context**: `srt, server`\n\nSets the maximum number of \"in flight\" packets (packets that were sent, but not yet acknowledged).\n\nSee the libsrt documentation of the `SRTO_FC` option for more details.\n\n#### mss\n* **syntax**: `mss size;`\n* **default**: `1500`\n* **context**: `srt, server`\n\nMaximum segment size, in bytes.\n\nSee the libsrt documentation of the `SRTO_MSS` option for more details.\n\n#### recv_buf\n* **syntax**: `recv_buf size;`\n* **default**: `8192 buffers`\n* **context**: `srt, server`\n\nReceive buffer size, in bytes.\n\nSee the libsrt documentation of the `SRTO_RCVBUF` option for more details.\n\n#### recv_udp_buf\n* **syntax**: `recv_udp_buf size;`\n* **default**: `8192 buffers`\n* **context**: `srt, server`\n\nUDP socket receive buffer size, in bytes.\n\nSee the libsrt documentation of the `SRTO_UDP_RCVBUF` option for more details.\n\n#### recv_latency\n* **syntax**: `recv_latency size;`\n* **default**: `120ms`\n* **context**: `srt, server`\n\nThe latency on the receiving side, in milliseconds.\n\nSee the libsrt documentation of the `SRTO_RCVLATENCY` option for more details.\n\n#### send_buf\n* **syntax**: `send_buf size;`\n* **default**: `8192 buffers`\n* **context**: `srt, server`\n\nSend buffer size, in bytes.\n\nSee the libsrt documentation of the `SRTO_SNDBUF` option for more details.\n\n#### send_udp_buf\n* **syntax**: `send_udp_buf size;`\n* **default**: `65536`\n* **context**: `srt, server`\n\nUDP socket send buffer size, in bytes.\n\nSee the libsrt documentation of the `SRTO_UDP_SNDBUF` option for more details.\n\n#### send_latency\n* **syntax**: `send_latency size;`\n* **default**: `120ms`\n* **context**: `srt, server`\n\nThe minimum receiving latency, provided by the sender.\n\nSee the libsrt documentation of the `SRTO_PEERLATENCY` option for more details.\n\n#### passphrase\n* **syntax**: `passphrase expr;`\n* **default**: ``\n* **context**: `srt, server`\n\nSets a passphrase for encryption, see the libsrt documentation of the `SRTO_PASSPHRASE` option for more details.\n\nThe parameter value can contain variables.\n\n#### in_buf_size\n* **syntax**: `in_buf_size size;`\n* **default**: `64k`\n* **context**: `srt, server`\n\nSets the size of the buffer used for reading data from the client.\n\n### srt map directives\n\n#### map\n* **syntax**: `map string $variable { ... }`\n* **default**: ``\n* **context**: `srt`\n\nCreates a new variable whose value depends on values of one or more of the source variables specified in the first parameter.\n\nSee the documentation of the `map` directive of the nginx `stream` module for more details.\n\n#### map_hash_max_size\n* **syntax**: `map_hash_max_size size;`\n* **default**: `2048`\n* **context**: `srt`\n\nSets the maximum size of the map variables hash table.\n\n#### map_hash_bucket_size\n* **syntax**: `map_hash_bucket_size size;`\n* **default**: `32|64|128`\n* **context**: `srt`\n\nSets the bucket size for the map variables hash table.\n\n### srt log directives\n\n#### access_log\n* **syntax**: `access_log path format [buffer=size] [gzip[=level]] [flush=time] [if=condition];`\n* **default**: `off`\n* **context**: `srt, server`\n\nSets the path, format, and configuration for a buffered log write.\n\nSee the documentation of the `access_log` directive of the nginx `stream` module for more details.\n\n#### log_format\n* **syntax**: `log_format name [escape=default|json|none] string ...;`\n* **default**: ``\n* **context**: `srt`\n\nDefines a log format.\n\nSee the documentation of the `log_format` directive of the nginx `stream` module for more details.\n\n#### open_log_file_cache\n* **syntax**: `open_log_file_cache max=N [inactive=time] [min_uses=N] [valid=time];`\n* **default**: `off`\n* **context**: `srt, server`\n\nDefines a cache that stores the file descriptors of frequently used logs whose names contain variables.\n\nSee the documentation of the `open_log_file_cache` directive of the nginx `stream` module for more details.\n\n### srt proxy directives\n\n#### proxy_pass\n* **syntax**: `proxy_pass address;`\n* **default**: ``\n* **context**: `srt, server`\n\nSets the address of the proxied server.\n\n#### proxy_connect_timeout\n* **syntax**: `proxy_connect_timeout timeout;`\n* **default**: `60s`\n* **context**: `srt, server`\n\nDefines a timeout for establishing a connection with a proxied server.\n\n#### proxy_timeout\n* **syntax**: `proxy_timeout timeout;`\n* **default**: `10m`\n* **context**: `srt, server`\n\nSets the timeout between two successive read or write operations on client or proxied server connections.\nIf no data is transmitted within this time, the connection is closed.\n\n#### proxy_buffer_size\n* **syntax**: `proxy_buffer_size size;`\n* **default**: `64k`\n* **context**: `srt, server`\n\nSets the size of the buffer used for reading data from the proxied server.\n\n#### proxy_protocol\n* **syntax**: `proxy_protocol on | off;`\n* **default**: `off`\n* **context**: `srt, server`\n\nEnables the PROXY protocol for connections to a proxied server.\n\n#### proxy_header\n* **syntax**: `proxy_header expr;`\n* **default**: ``\n* **context**: `srt, server`\n\nDefines a string that is sent to the proxied server before any data received over SRT.\n\nThe parameter value can contain variables.\n\n### srt set misc directives\n\n#### set_decode_base64\n* **syntax**: `set_decode_base64 $dst src;`\n* **default**: ``\n* **context**: `srt`\n\nPerforms base64 decode of the value of the second argument, and assigns the result to the variable specified in the first argument.\n\n#### set_decode_base64url\n* **syntax**: `set_decode_base64url $dst src;`\n* **default**: ``\n* **context**: `srt`\n\nPerforms url-safe-base64 decode of the value of the second argument, and assigns the result to the variable specified in the first argument.\n\n#### set_aes_decrypt\n* **syntax**: `set_aes_decrypt $dst base64_key base64_iv src;`\n* **default**: ``\n* **context**: `srt`\n\nPerforms AES-256-CBC decryption of the value of the last argument, using the supplied key/iv, and assigns the result to the variable specified in the first argument.\n\n### stream srt proxy directives\n\n#### srt_proxy_pass\n* **syntax**: `srt_proxy_pass address;`\n* **default**: ``\n* **context**: `stream, server`\n\nSets the address of the proxied server.\n\n#### srt_proxy_connect_timeout\n* **syntax**: `srt_proxy_connect_timeout timeout;`\n* **default**: `60s`\n* **context**: `srt, server`\n\nDefines a timeout for establishing a connection with a proxied server.\n\n#### srt_proxy_timeout\n* **syntax**: `srt_proxy_timeout timeout;`\n* **default**: `10m`\n* **context**: `srt, server`\n\nSets the timeout between two successive read or write operations on client or proxied server connections.\nIf no data is transmitted within this time, the connection is closed.\n\n#### srt_proxy_buffer_size\n* **syntax**: `srt_proxy_buffer_size size;`\n* **default**: `64k`\n* **context**: `srt, server`\n\nSets the size of the buffer used for reading data from the proxied server.\n\n#### srt_proxy_stream_id\n* **syntax**: `srt_proxy_stream_id expr;`\n* **default**: ``\n* **context**: `srt, server`\n\nSets the SRT stream id, see the libsrt documentation of the `SRTO_STREAMID` option for more details.\n\nThe parameter value can contain variables.\n\n#### srt_proxy_passphrase\n* **syntax**: `srt_proxy_passphrase expr;`\n* **default**: ``\n* **context**: `srt, server`\n\nSets a passphrase for encryption, see the libsrt documentation of the `SRTO_PASSPHRASE` option for more details.\n\nThe parameter value can contain variables.\n\n## Embedded Variables\n\n### Core\n\n* `binary_remote_addr` - client address in a binary form, the length of the value is always 4 bytes for IPv4 addresses or 16 bytes for IPv6 addresses\n* `bytes_received` - number of bytes received from the client\n* `bytes_sent` - number of bytes sent to the client\n* `connection` - connection serial number\n* `hostname` - host name\n* `msec` - current time, in seconds with milliseconds resolution\n* `nginx_version` - nginx version\n* `peer_version` - libsrt version of the remote peer, see the libsrt documentation of the `SRTO_PEERVERSION` option for more details.\n* `pid` - PID of the worker process\n* `protocol` - protocol used to communicate with the client, always evaluates to `SRT`\n* `remote_addr` - client address\n* `remote_port` - client port\n* `server_addr` - the address of the server which accepted the connection\n* `server_port` - the port of the server which accepted the connection\n* `session_time` - session duration, in seconds with a milliseconds resolution\n* `status` - session status\n* `stream_id` - SRT stream id, see the libsrt documentation of the `SRTO_STREAMID` option for more details.\n* `time_iso8601` - local time, in ISO 8601 standard format\n* `time_local` - local time, in the Common Log Format\n\n### Upstream\n\n* `upstream_addr` - the IP address and port of the upstream server\n* `upstream_bytes_received` - number of bytes received from the upstream server\n* `upstream_bytes_sent` - number of bytes sent to the upstream server\n* `upstream_connect_time` - time to connect to the upstream server, in seconds with millisecond resolution\n* `upstream_first_byte_time` - time to receive the first byte of data, in seconds with millisecond resolution\n* `upstream_session_time` - session duration, in seconds with millisecond resolution\n\n## Copyright \u0026 License\n\nAll code in this project is released under the [AGPLv3 license](http://www.gnu.org/licenses/agpl-3.0.html) unless a different license for a particular library is specified in the applicable library path.\n\nCopyright © Kaltura Inc. All rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaltura%2Fnginx-srt-module","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkaltura%2Fnginx-srt-module","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkaltura%2Fnginx-srt-module/lists"}