Skip to content

Commit e274abc

Browse files
authoredMar 26, 2025··
Merge pull request #166 from ngrok/danielle/enable-endpoint-pooling
feat: Enable endpoint pooling configuration
2 parents 03552bc + 807f674 commit e274abc

9 files changed

+111
-17
lines changed
 

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
## 1.5.0
2+
Adds `poolingEnabled` to listener builders, allowing the endpoint to pool with other endpoints with the same host/port/binding
3+
14
## 1.4.1
25

36
- Fix `traffic_policy` naming for `ngrok.forward`

‎Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
edition = "2021"
33
name = "ngrok-javascript"
4-
version = "1.4.0"
4+
version = "1.5.0"
55

66
[lib]
77
crate-type = ["cdylib"]
@@ -17,7 +17,7 @@ mio = { version = "=0.8.6" }
1717
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
1818
napi = { version = "2.12.1", default-features = false, features = ["napi4", "tokio_rt"] }
1919
napi-derive = "2.12.1"
20-
ngrok = { version = "=0.14.0-pre.17", features = ["hyper", "axum"]}
20+
ngrok = {version = "0.14.0", features = ["hyper", "axum"]}
2121
parking_lot = "0.12.1"
2222
regex = "1.9.5"
2323
rustls = "0.22.2"

‎README.md

+5-3
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ const listener = await ngrok.forward({
260260
oidc_allow_domains: ["<domain>"],
261261
oidc_allow_emails: ["<email>"],
262262
oidc_scopes: ["<scope>"],
263+
pooling_enabled: false,
263264
traffic_policy: "<policy_json>",
264265
request_header_remove: ["X-Req-Nope"],
265266
response_header_remove: ["X-Res-Nope"],
@@ -318,8 +319,8 @@ Pre-built binaries are provided on NPM for the following platforms:
318319

319320
| OS | i686 | x64 | aarch64 | arm |
320321
| ---------- | -----|-----|---------|-----|
321-
| Windows ||| * | |
322-
| MacOS | ||| |
322+
| Windows ||| | |
323+
| MacOS | ||| |
323324
| Linux | ||||
324325
| Linux musl | ||| |
325326
| FreeBSD | || | |
@@ -329,7 +330,8 @@ Pre-built binaries are provided on NPM for the following platforms:
329330
> `ngrok-javascript`, and [ngrok-rust](https://github.com/ngrok/ngrok-rust/) which it depends on, are open source, so it may be possible to build them for other platforms.
330331
>
331332
> On Windows, ensure you have [Microsoft Visual C++ Redistributable](https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170#latest-microsoft-visual-c-redistributable-version) installed.
332-
> * `Windows-aarch64` will be supported after the next release of [Ring](https://github.com/briansmith/ring/issues/1167).
333+
>
334+
> We currently support MacOS 10.13+.
333335

334336
# Dependencies
335337

‎index.d.ts

+14-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎index.js

+61-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@ngrok/ngrok",
3-
"version": "1.5",
3+
"version": "1.5.0",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"files": [

‎src/http.rs

+8
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,14 @@ impl HttpListenerBuilder {
237237
self
238238
}
239239

240+
/// Enable endpoint pooling for this listener.
241+
#[napi]
242+
pub fn pooling_enabled(&mut self, pooling_enabled: bool) -> &Self {
243+
let mut builder = self.listener_builder.lock();
244+
builder.pooling_enabled(pooling_enabled);
245+
self
246+
}
247+
240248
/// WebhookVerification configuration.
241249
/// If not called, WebhookVerification is disabled.
242250
/// See [Webhook Verification] in the ngrok docs for additional details.

‎src/tcp.rs

+8
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,12 @@ impl TcpListenerBuilder {
1515
builder.remote_addr(remote_addr);
1616
self
1717
}
18+
19+
/// Enable endpoint pooling for this listener.
20+
#[napi]
21+
pub fn pooling_enabled(&mut self, pooling_enabled: bool) -> &Self {
22+
let mut builder = self.listener_builder.lock();
23+
builder.pooling_enabled(pooling_enabled);
24+
self
25+
}
1826
}

‎src/tls.rs

+9
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,15 @@ impl TlsListenerBuilder {
2828
builder.mutual_tlsca(Bytes::from(mutual_tlsca.to_vec()));
2929
self
3030
}
31+
32+
/// Enable endpoint pooling for this listener.
33+
#[napi]
34+
pub fn pooling_enabled(&mut self, pooling_enabled: bool) -> &Self {
35+
let mut builder = self.listener_builder.lock();
36+
builder.pooling_enabled(pooling_enabled);
37+
self
38+
}
39+
3140
/// The key to use for TLS termination at the ngrok edge in PEM format.
3241
/// See [TLS Termination] in the ngrok docs for additional details.
3342
///

0 commit comments

Comments
 (0)
Please sign in to comment.