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
4 changes: 2 additions & 2 deletions __test__/online.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ test("tls backend", async (t) => {
{ instanceOf: AxiosError }
);
t.is(421, error.response.status);
t.truthy(error.response.headers["ngrok-trace-id"]);
t.truthy(error.response.data.includes("different Host"));
await listener.close();
});

Expand All @@ -153,7 +153,7 @@ test("unverified tls backend", async (t) => {
{ instanceOf: AxiosError }
);
t.is(421, error.response.status);
t.truthy(error.response.headers["ngrok-trace-id"]);
t.truthy(error.response.data.includes("different Host"));
await listener.close();
});

Expand Down
9 changes: 4 additions & 5 deletions examples/nextjs/ngrok.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
const ngrok = require("@ngrok/ngrok");

// setup ngrok ingress in the parent process
var makeListener = true;

// setup ngrok ingress in the parent process,
// in forked processes "send" will exist.
const makeListener = process.send === undefined;
var host = "localhost";
var port = process.env.PORT || "3000";

process.argv.forEach((item, index) => {
// The first process to configure is a child which runs building, then the parent
// configures later, so use arguments rather than environment variable to run once.
if (item.includes("processChild")) makeListener = false;
if (["--hostname", "-H"].includes(item)) host = process.argv[index + 1];
if (["--port", "-p"].includes(item)) port = process.argv[index + 1];
});
Expand Down
2 changes: 1 addition & 1 deletion examples/nextjs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"dependencies": {
"@ngrok/ngrok": "^1.*",
"next": "13.3.0"
"next": "14.0.4"
}
}
42 changes: 30 additions & 12 deletions flake.lock

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

7 changes: 0 additions & 7 deletions src/listener_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,6 @@ use std::{
use napi::bindgen_prelude::*;
use napi_derive::napi;
use ngrok::{
config::{
HttpTunnelBuilder,
LabeledTunnelBuilder,
ProxyProto,
TcpTunnelBuilder,
TlsTunnelBuilder,
},
prelude::*,
Session,
};
Expand Down
2 changes: 1 addition & 1 deletion src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub(crate) struct SessionBuilder {
}

#[napi]
#[cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))]
#[cfg_attr(feature = "clippy", allow(clippy::new_without_default))]
#[allow(dead_code)]
impl SessionBuilder {
/// Create a new session builder
Expand Down