diff --git a/src/node/plugin.ts b/src/node/plugin.ts index cdc5919f3..c2e431738 100644 --- a/src/node/plugin.ts +++ b/src/node/plugin.ts @@ -1,10 +1,11 @@ -import { Logger, field } from "@coder/logger" +import { field, Logger } from "@coder/logger" import * as express from "express" import * as fs from "fs" import * as path from "path" import * as semver from "semver" import * as pluginapi from "../../typings/pluginapi" import { version } from "./constants" +import { proxy } from "./proxy" import * as util from "./util" const fsp = fs.promises @@ -19,6 +20,7 @@ require("module")._load = function (request: string, parent: object, isMain: boo return { express, field, + proxy, } } return originalLoad.apply(this, [request, parent, isMain]) diff --git a/typings/pluginapi.d.ts b/typings/pluginapi.d.ts index 5dd2a066a..14d6cb487 100644 --- a/typings/pluginapi.d.ts +++ b/typings/pluginapi.d.ts @@ -94,6 +94,8 @@ export { express } */ export { field } +export const proxy: ProxyServer + /** * Your plugin module must have a top level export "plugin" that implements this interface. *