Skip to content
Draft
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
83 changes: 69 additions & 14 deletions Cargo.lock

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

5 changes: 3 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[package]
edition = "2021"
edition = "2024"
rust-version = "1.88"
name = "ngrok-javascript"
version = "1.7.0"

Expand All @@ -17,7 +18,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.18.0", features = ["hyper", "axum"]}
ngrok = { version = "0.19.0", features = ["hyper", "axum"] }
parking_lot = "0.12.1"
regex = "1.9.5"
rustls = "0.23.25"
Expand Down
12 changes: 6 additions & 6 deletions flake.lock

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

2 changes: 1 addition & 1 deletion src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
pub fn authtoken_from_env(&mut self) -> &Self {
let mut builder = self.raw_builder.lock();
builder.authtoken_from_env();
if let Ok(token) = env::var("NGROK_AUTHTOKEN") {

Check failure on line 125 in src/session.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `if` statement can be collapsed

Check failure on line 125 in src/session.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `if` statement can be collapsed
if !token.is_empty() {
self.auth_token_set = true;
}
Expand Down Expand Up @@ -284,7 +284,7 @@
let disconn_tsfn = disconnect_handler.clone();
async move {
// call disconnect javascript handler
if let Some(handler) = disconn_tsfn {

Check failure on line 287 in src/session.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `if` statement can be collapsed

Check failure on line 287 in src/session.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `if` statement can be collapsed
if let Some(err) = err.clone() {
// call javascript handler
let resp: Option<bool> = handler
Expand All @@ -295,7 +295,7 @@
.await
.map_err(|_e| ConnectError::Canceled)?;

if let Some(reconnect) = resp {

Check failure on line 298 in src/session.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `if` statement can be collapsed

Check failure on line 298 in src/session.rs

View workflow job for this annotation

GitHub Actions / Clippy

this `if` statement can be collapsed
if !reconnect {
info!("Aborting connection to {host}:{port}");
println!("Aborting connection to {host}:{port}"); // still shown if this takes down the process
Expand All @@ -318,7 +318,7 @@
.clone()
.lock()
.await
.call_async(args)
.call_async::<()>(args)
.await
.map_err(|_e| ConnectError::Canceled)?;
}
Expand Down
Loading