http-proxy-middleware.d.ts 902 B

1234567891011121314151617181920212223242526272829
  1. import type { RequestHandler, Options } from './types';
  2. export declare class HttpProxyMiddleware<TReq, TRes> {
  3. private wsInternalSubscribed;
  4. private serverOnCloseSubscribed;
  5. private proxyOptions;
  6. private proxy;
  7. private pathRewriter;
  8. private logger;
  9. constructor(options: Options<TReq, TRes>);
  10. middleware: RequestHandler;
  11. private registerPlugins;
  12. private catchUpgradeRequest;
  13. private handleUpgrade;
  14. /**
  15. * Determine whether request should be proxied.
  16. */
  17. private shouldProxy;
  18. /**
  19. * Apply option.router and option.pathRewrite
  20. * Order matters:
  21. * Router uses original path for routing;
  22. * NOT the modified path, after it has been rewritten by pathRewrite
  23. * @param {Object} req
  24. * @return {Object} proxy options
  25. */
  26. private prepareProxyRequest;
  27. private applyRouter;
  28. private applyPathRewrite;
  29. }