### Basic Surfboard Configuration Source: https://surgio.js.org/guide/custom-config.html An example of how to set up the basic surfboard configuration object in surgio.conf.js. ```javascript // surgio.conf.js module.exports = { surfboardConfig: {}, }; ``` -------------------------------- ### Shadowsocks Node Configuration Example Source: https://surgio.js.org/guide/custom-provider.html An example of a Shadowsocks node configuration, demonstrating common properties like 'enable', 'type', 'nodeName', 'hostname', 'port', 'method', and 'password'. The 'enable' property can be used to individually disable a node's output. ```json { enable: false, type: 'shadowsocks', nodeName: '🇺🇸US', hostname: 'us.example.com', port: 10000, method: 'chacha20-ietf-poly1305', password: 'password', } ``` -------------------------------- ### Basic Gateway Configuration Source: https://surgio.js.org/guide/custom-config.html An example of how to set up the basic gateway configuration object in surgio.conf.js. ```javascript // surgio.conf.js module.exports = { gateway: {}, }; ``` -------------------------------- ### Gateway Header Forwarding Configuration Source: https://surgio.js.org/guide/custom-config.html Configures the gateway to forward custom headers to upstream subscription servers. This example shows how to add 'x-custom' to the list of forwarded headers. ```javascript // surgio.conf.js module.exports = { gateway: { passRequestHeaders: ["x-custom"], // 不会覆盖内部默认值 }, }; ``` -------------------------------- ### Get Generic URL Source: https://surgio.js.org/guide/custom-template.html Use getUrl to construct a generic URL, useful for future Surgio API endpoints. ```javascript getUrl('/export-provider?format=surge-policy'); ``` -------------------------------- ### Sing-box Multiplex Configuration Source: https://surgio.js.org/guide/custom-provider.html Example configuration for sing-box multiplexing, supporting protocols like smux, yamux, and h2mux. It allows setting maximum connections, streams, and enabling padding. The 'brutal' option can be used for TCP Brutal congestion control. ```json { multiplex: { protocol: '', // smux, yamux, h2mux maxConnections: 1, // 最大连接数量,与 max_streams 冲突 minStreams: 1, // 在打开新连接之前,连接中的最小多路复用流数量,与 max_streams 冲突 maxStreams: 1, // 在打开新连接之前,连接中的最大多路复用流数量,与 max_connections 和 min_streams 冲突 padding: false, // 启用填充 brutal: { // 可选,TCP Brutal 拥塞控制算法 upMbps: 0, // 上行 Mbps downMbps: 0, // 下行 Mbps }, } } ``` -------------------------------- ### Get File Download URL Source: https://surgio.js.org/guide/custom-template.html Use getDownloadUrl to obtain the download URL for another file. It automatically appends the urlBase and can handle query parameters. ```javascript getDownloadUrl('example.conf'); // https://example.com/example.conf ``` ```javascript getDownloadUrl('example.conf?foo=bar'); // https://example.com/example.conf?foo=bar ``` -------------------------------- ### Generate Singbox Node Names with Filters Source: https://surgio.js.org/guide/custom-template.html Use getSingboxNodeNames to get an array of node names for sing-box rules. An optional filter can be applied. ```javascript getSingboxNodeNames(nodeList, netflixFilter); ``` -------------------------------- ### Generate Clash Node Names with Filters and Prepend Source: https://surgio.js.org/guide/custom-template.html Use getClashNodeNames to get an array of node names for Clash rules. Optional parameters allow filtering and prepending custom node names. ```javascript getClashNodeNames(nodeList, netflixFilter); ``` ```javascript getClashNodeNames(nodeList, netflixFilter, ['测试节点']); ``` ```javascript getClashNodeNames(nodeList, netflixFilter, [], ['默认节点']); ``` -------------------------------- ### Generate Surge WireGuard and Proxy Group Configuration Source: https://surgio.js.org/guide/custom-template.html Combine getSurgeNodes for the [Proxy] section and getSurgeWireguardNodes for other configurations, along with getSurgeNodeNames for the [Proxy Group] section. ```template [Proxy] {{ getSurgeNodes(nodeList) }} [Proxy Group] Proxy = select, {{ getSurgeNodeNames(nodeList) }} {{ getSurgeWireguardNodes(nodeList) }} ``` -------------------------------- ### Generate Surfboard Proxy Configuration Source: https://surgio.js.org/guide/custom-template.html Use getSurfboardNodes to generate proxy node information for Surfboard, conforming to the [Proxy] specification. ```template [Proxy] {{ getSurfboardNodes(nodeList) }} ``` -------------------------------- ### Generate Surge Proxy Configuration Source: https://surgio.js.org/guide/custom-template.html Use getSurgeNodes to generate a list of proxy nodes for Surge. It supports various protocols like Shadowsocks, Vmess, and Trojan. ```template [Proxy] {{ getSurgeNodes(nodeList) }} ``` -------------------------------- ### Generate Loon Proxy Configuration Source: https://surgio.js.org/guide/custom-template.html Use getLoonNodes to generate proxy node information conforming to the [Proxy] specification for Loon. ```template [Proxy] {{ getLoonNodes(nodeList) }} ``` -------------------------------- ### Generate Shadowsocks Scheme List Source: https://surgio.js.org/guide/custom-template.html Use getShadowsocksNodes to generate Shadowsocks scheme lists. The providerName parameter specifies the group name. ```template {{ getShadowsocksNodes(nodeList, providerName) | base64 }} ``` -------------------------------- ### Call Template Method Source: https://surgio.js.org/guide/custom-template.html Template methods are called within template files by wrapping the method call in {{ }}. ```template {{ getSurgeNodes(nodeList) }} ``` -------------------------------- ### Trojan Provider Configuration Source: https://surgio.js.org/guide/custom-provider.html Defines a custom provider for the Trojan protocol. Ensure the 'url' field is correctly set. This method only supports standard Trojan protocol, not WebSocket or gRPC. ```javascript module.exports = { type: 'trojan', url: '', } ``` -------------------------------- ### Generate Comma-Separated Node Names Source: https://surgio.js.org/guide/custom-template.html Use getNodeNames to generate a comma-separated string of node names. Filters and custom separators can be applied. ```javascript getNodeNames(nodeList, netflixFilter); ``` ```javascript getNodeNames(nodeList, undefined, ':'); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.