Skip to content

Commit 8c1a453

Browse files
authored
Merge pull request #136 from ngrok/bob/new-next
update next.js to 14
2 parents aadea81 + e7cb255 commit 8c1a453

File tree

6 files changed

+38
-28
lines changed

6 files changed

+38
-28
lines changed

__test__/online.spec.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ test("tls backend", async (t) => {
137137
{ instanceOf: AxiosError }
138138
);
139139
t.is(421, error.response.status);
140-
t.truthy(error.response.headers["ngrok-trace-id"]);
140+
t.truthy(error.response.data.includes("different Host"));
141141
await listener.close();
142142
});
143143

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

examples/nextjs/ngrok.config.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
const ngrok = require("@ngrok/ngrok");
22

3-
// setup ngrok ingress in the parent process
4-
var makeListener = true;
3+
4+
// setup ngrok ingress in the parent process,
5+
// in forked processes "send" will exist.
6+
const makeListener = process.send === undefined;
57
var host = "localhost";
68
var port = process.env.PORT || "3000";
79

810
process.argv.forEach((item, index) => {
9-
// The first process to configure is a child which runs building, then the parent
10-
// configures later, so use arguments rather than environment variable to run once.
11-
if (item.includes("processChild")) makeListener = false;
1211
if (["--hostname", "-H"].includes(item)) host = process.argv[index + 1];
1312
if (["--port", "-p"].includes(item)) port = process.argv[index + 1];
1413
});

examples/nextjs/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"dependencies": {
33
"@ngrok/ngrok": "^1.*",
4-
"next": "13.3.0"
4+
"next": "14.0.4"
55
}
66
}

flake.lock

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

src/listener_builder.rs

-7
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,6 @@ use std::{
66
use napi::bindgen_prelude::*;
77
use napi_derive::napi;
88
use ngrok::{
9-
config::{
10-
HttpTunnelBuilder,
11-
LabeledTunnelBuilder,
12-
ProxyProto,
13-
TcpTunnelBuilder,
14-
TlsTunnelBuilder,
15-
},
169
prelude::*,
1710
Session,
1811
};

src/session.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub(crate) struct SessionBuilder {
8383
}
8484

8585
#[napi]
86-
#[cfg_attr(feature = "cargo-clippy", allow(clippy::new_without_default))]
86+
#[cfg_attr(feature = "clippy", allow(clippy::new_without_default))]
8787
#[allow(dead_code)]
8888
impl SessionBuilder {
8989
/// Create a new session builder

0 commit comments

Comments
 (0)