Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 1.5.0
Adds `poolingEnabled` to listener builders, allowing the endpoint to pool with other endpoints with the same host/port/binding

## 1.4.1

- Fix `traffic_policy` naming for `ngrok.forward`
Expand Down
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
edition = "2021"
name = "ngrok-javascript"
version = "1.4.0"
version = "1.5.0"

[lib]
crate-type = ["cdylib"]
Expand All @@ -17,7 +17,7 @@ mio = { version = "=0.8.6" }
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "2.12.1", default-features = false, features = ["napi4", "tokio_rt"] }
napi-derive = "2.12.1"
ngrok = { version = "=0.14.0-pre.17", features = ["hyper", "axum"]}
ngrok = {version = "0.14.0", features = ["hyper", "axum"]}
parking_lot = "0.12.1"
regex = "1.9.5"
rustls = "0.22.2"
Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ const listener = await ngrok.forward({
oidc_allow_domains: ["<domain>"],
oidc_allow_emails: ["<email>"],
oidc_scopes: ["<scope>"],
pooling_enabled: false,
traffic_policy: "<policy_json>",
request_header_remove: ["X-Req-Nope"],
response_header_remove: ["X-Res-Nope"],
Expand Down Expand Up @@ -318,8 +319,8 @@ Pre-built binaries are provided on NPM for the following platforms:

| OS | i686 | x64 | aarch64 | arm |
| ---------- | -----|-----|---------|-----|
| Windows | ✓ | ✓ | * | |
| MacOS | | ✓ | ✓ | |
| Windows | ✓ | ✓ | | |
| MacOS | | ✓ | ✓ | |
| Linux | | ✓ | ✓ | ✓ |
| Linux musl | | ✓ | ✓ | |
| FreeBSD | | ✓ | | |
Expand All @@ -329,7 +330,8 @@ Pre-built binaries are provided on NPM for the following platforms:
> `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.
>
> 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.
> * `Windows-aarch64` will be supported after the next release of [Ring](https://github.com/briansmith/ring/issues/1167).
>
> We currently support MacOS 10.13+.

# Dependencies

Expand Down
22 changes: 14 additions & 8 deletions index.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

64 changes: 61 additions & 3 deletions index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ngrok/ngrok",
"version": "1.5",
"version": "1.5.0",
"main": "index.js",
"types": "index.d.ts",
"files": [
Expand Down
8 changes: 8 additions & 0 deletions src/http.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,14 @@ impl HttpListenerBuilder {
self
}

/// Enable endpoint pooling for this listener.
#[napi]
pub fn pooling_enabled(&mut self, pooling_enabled: bool) -> &Self {
let mut builder = self.listener_builder.lock();
builder.pooling_enabled(pooling_enabled);
self
}

/// WebhookVerification configuration.
/// If not called, WebhookVerification is disabled.
/// See [Webhook Verification] in the ngrok docs for additional details.
Expand Down
8 changes: 8 additions & 0 deletions src/tcp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,12 @@ impl TcpListenerBuilder {
builder.remote_addr(remote_addr);
self
}

/// Enable endpoint pooling for this listener.
#[napi]
pub fn pooling_enabled(&mut self, pooling_enabled: bool) -> &Self {
let mut builder = self.listener_builder.lock();
builder.pooling_enabled(pooling_enabled);
self
}
}
9 changes: 9 additions & 0 deletions src/tls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ impl TlsListenerBuilder {
builder.mutual_tlsca(Bytes::from(mutual_tlsca.to_vec()));
self
}

/// Enable endpoint pooling for this listener.
#[napi]
pub fn pooling_enabled(&mut self, pooling_enabled: bool) -> &Self {
let mut builder = self.listener_builder.lock();
builder.pooling_enabled(pooling_enabled);
self
}

/// The key to use for TLS termination at the ngrok edge in PEM format.
/// See [TLS Termination] in the ngrok docs for additional details.
///
Expand Down