Skip to content

Commit 39bee36

Browse files
committed
allow specifying endpoint bindings
1 parent ab26dcd commit 39bee36

File tree

5 files changed

+42
-0
lines changed

5 files changed

+42
-0
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Unreleased
2+
3+
- Support manually specifying bindings
4+
15
## 1.6.0
26

37
- Updated the internal ngrok SDK

index.d.ts

Lines changed: 24 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,4 +325,8 @@ pub struct Config {
325325
/// Convert incoming websocket connections to TCP-like streams.
326326
#[napi(js_name = "websocket_tcp_converter")]
327327
pub websocket_tcp_converter: Option<bool>,
328+
/// Sets the ingress configuration for this endpoint.
329+
/// Valid values: "public", "internal", "kubernetes"
330+
/// If not specified, the ngrok service will use its default binding configuration.
331+
pub binding: Option<String>,
328332
}

src/connect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ macro_rules! config_common {
105105
plumb!($builder, $config, traffic_policy);
106106
// policy is in the process of being deprecated. for now, we just remap it to traffic_policy
107107
plumb!($builder, $config, traffic_policy, policy);
108+
plumb!($builder, $config, binding);
108109
};
109110
}
110111

src/listener_builder.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,15 @@ macro_rules! make_listener_builder {
176176
builder.traffic_policy(traffic_policy);
177177
self
178178
}
179+
/// Sets the ingress configuration for this endpoint.
180+
/// Valid values: "public", "internal", "kubernetes"
181+
/// If not specified, the ngrok service will use its default binding configuration.
182+
#[napi]
183+
pub fn binding(&mut self, binding: String) -> &Self {
184+
let mut builder = self.listener_builder.lock();
185+
builder.binding(binding);
186+
self
187+
}
179188
}
180189
};
181190

0 commit comments

Comments
 (0)