File tree Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Expand file tree Collapse file tree 2 files changed +11
-3
lines changed Original file line number Diff line number Diff line change
1
+ "use strict" ;
1
2
const { spawn } = require ( "node:child_process" ) ;
2
3
const fs = require ( "node:fs" ) ;
3
4
const fetch = require ( "node-fetch" ) ;
@@ -122,10 +123,13 @@ async function main() {
122
123
console . info ( `Creating a tunnel to ${ url } ...` ) ;
123
124
const tunnel = await localtunnel ( {
124
125
port : url . port ,
125
- local_host : url . hostname ,
126
+ // NOTE: if we specify `local_host`, `localtunnel` will try to rewrite the `Host` header in the
127
+ // tunnelled HTTP requests. Unfortunately, they do it in a very silly way by converting the
128
+ // tunnelled data to a string, thus corrupting the request body.
129
+ //local_host: url.hostname,
126
130
} ) ;
127
131
128
- clientUrlInsideVercel = new URL ( tunnel . url ) ;
132
+ let clientUrlInsideVercel = new URL ( tunnel . url ) ;
129
133
if ( url . protocol === "http:" ) {
130
134
clientUrlInsideVercel . protocol = "https:" ;
131
135
} else if ( url . protocol === "ws:" ) {
Original file line number Diff line number Diff line change
1
+ "use strict" ;
1
2
const localtunnel = require ( "localtunnel" ) ;
2
3
const wrangler = require ( "wrangler" ) ;
3
4
@@ -15,7 +16,10 @@ async function main() {
15
16
console . info ( `Creating an tunnel to ${ url } ...` ) ;
16
17
tunnel = await localtunnel ( {
17
18
port : url . port ,
18
- local_host : url . hostname ,
19
+ // NOTE: if we specify `local_host`, `localtunnel` will try to rewrite the `Host` header in the
20
+ // tunnelled HTTP requests. Unfortunately, they do it in a very silly way by converting the
21
+ // tunnelled data to a string, thus corrupting the request body.
22
+ //local_host: url.hostname,
19
23
} ) ;
20
24
21
25
clientUrlInsideWorker = new URL ( tunnel . url ) ;
You can’t perform that action at this time.
0 commit comments