Skip to content

Commit 03f1a85

Browse files
committed
Merge branch 'master' of github.com:fastify/fastify-http-proxy
2 parents 59374e6 + f305d1e commit 03f1a85

File tree

7 files changed

+11
-9
lines changed

7 files changed

+11
-9
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,5 @@ on:
1313
jobs:
1414
test:
1515
uses: fastify/workflows/.github/workflows/plugins-ci.yml@v3
16+
with:
17+
license-check: true

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ server.register(require('@fastify/http-proxy'), {
3535
http2: false // optional
3636
})
3737

38-
server.listen(3000)
38+
server.listen({ port: 3000 })
3939
```
4040

4141
This will proxy any request starting with `/api` to `http://my-api.example.com`. For instance `http://localhost:3000/api/users` will be proxied to `http://my-api.example.com/users`.
@@ -69,7 +69,7 @@ server.register(proxy, {
6969
http2: false // optional
7070
})
7171

72-
server.listen(3000)
72+
server.listen({ port: 3000 })
7373
```
7474

7575
Notice that in this case it is important to use the `prefix` option to tell the proxy how to properly route the requests across different upstreams.
@@ -98,7 +98,7 @@ server.register(proxy, {
9898
})
9999

100100

101-
server.listen(3000);
101+
server.listen({ port: 3000 });
102102
```
103103

104104
## Options

benchmarks/fast-proxy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ async function startProxy (base) {
1919
proxy(request.raw, reply.raw, request.url, {})
2020
})
2121

22-
await server.listen(3000)
22+
await server.listen({ port: 3000 })
2323
return server
2424
}
2525

benchmarks/fastify-proxy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async function startProxy (upstream) {
2020
undici
2121
})
2222

23-
await server.listen(3000)
23+
await server.listen({ port: 3000 })
2424
return server
2525
}
2626

benchmarks/origin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async function startOrigin () {
2121
throw new Error('kaboom')
2222
})
2323

24-
await origin.listen(3001)
24+
await origin.listen({ port: 3001 })
2525

2626
return origin
2727
}

examples/example.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ async function startOrigin () {
2525
throw new Error('kaboom')
2626
})
2727

28-
await origin.listen(0)
28+
await origin.listen()
2929

3030
return origin
3131
}
@@ -37,7 +37,7 @@ async function startProxy (upstream) {
3737
prefix: '/upstream' // optional
3838
})
3939

40-
await server.listen(3000)
40+
await server.listen({ port: 3000 })
4141
return server
4242
}
4343

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"socket.io-client": "^4.4.1",
4848
"standard": "^17.0.0",
4949
"tap": "^16.0.0",
50-
"tsd": "^0.21.0",
50+
"tsd": "^0.22.0",
5151
"typescript": "^4.5.4",
5252
"why-is-node-running": "^2.2.2"
5353
},

0 commit comments

Comments
 (0)