File tree Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Expand file tree Collapse file tree 2 files changed +10
-15
lines changed Original file line number Diff line number Diff line change 11/// <reference types="node" />
22
3- import {
4- FastifyPlugin ,
5- preHandlerHookHandler
6- } from "fastify" ;
3+ import { FastifyPlugin , preHandlerHookHandler } from "fastify" ;
74
85import {
9- FastifyReplyFromOptions
10- } from "fastify-reply-from"
6+ FastifyReplyFromOptions ,
7+ FastifyReplyFromHooks ,
8+ } from "fastify-reply-from" ;
119
12- import {
13- ClientOptions ,
14- ServerOptions
15- } from "ws"
10+ import { ClientOptions , ServerOptions } from "ws" ;
1611
1712export interface FastifyHttpProxyOptions extends FastifyReplyFromOptions {
1813 upstream : string ;
@@ -22,10 +17,10 @@ export interface FastifyHttpProxyOptions extends FastifyReplyFromOptions {
2217 preHandler ?: preHandlerHookHandler ;
2318 beforeHandler ?: preHandlerHookHandler ;
2419 config ?: Object ;
25- replyOptions ?: Object ;
26- websocket ?: boolean
27- wsClientOptions ?: ClientOptions
28- wsServerOptions ?: ServerOptions
20+ replyOptions ?: FastifyReplyFromHooks ;
21+ websocket ?: boolean ;
22+ wsClientOptions ?: ClientOptions ;
23+ wsServerOptions ?: ServerOptions ;
2924}
3025
3126declare const fastifyHttpProxy : FastifyPlugin < FastifyHttpProxyOptions > ;
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ app.register(fastifyHttpProxy, {
1414 rewritePrefix : "/u" ,
1515 http2 : false ,
1616 config : { key : 1 } ,
17- replyOptions : { opt : "a " } ,
17+ replyOptions : { contentType : "application/json " } ,
1818 preHandler : ( request , reply ) => {
1919 expectType < RawRequestDefaultExpression > ( request . raw ) ;
2020 expectType < RawReplyDefaultExpression > ( reply . raw ) ;
You can’t perform that action at this time.
0 commit comments