Skip to content

Commit 2e832ca

Browse files
author
Luca Forstner
committed
Add some comments
1 parent 4822861 commit 2e832ca

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

packages/event-proxy-server/src/index.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,25 @@ import type { AddressInfo } from 'net';
77
import * as os from 'os';
88
import * as path from 'path';
99

10+
interface EventProxyServerOptions {
11+
/** Port to start the event proxy server at. */
12+
port: number;
13+
/** The name for the proxy server used for referencing it with listener functions */
14+
proxyServerName: string;
15+
}
16+
1017
interface SentryRequestCallbackData {
1118
envelope: Envelope;
1219
rawProxyRequestBody: string;
1320
rawSentryResponseBody: string;
1421
sentryResponseStatusCode?: number;
1522
}
1623

17-
export async function startEventProxyServer(options: { port: number; proxyServerName: string }): Promise<void> {
24+
/**
25+
* Starts an event proxy server that will proxy events to sentry when the `tunnel` option is used. Point the `tunnel`
26+
* option to this server (like this `tunnel: http://localhost:${port option}/`).
27+
*/
28+
export async function startEventProxyServer(options: EventProxyServerOptions): Promise<void> {
1829
const eventCallbackListeners: Set<(data: string) => void> = new Set();
1930

2031
const proxyServer = http.createServer((proxyRequest, proxyResponse) => {

packages/event-proxy-server/tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"extends": "../../tsconfig.json",
33
"compilerOptions": {
4-
"module": "esnext",
4+
"module": "ES2015",
55
"outDir": "build"
66
},
77
"include": ["src/**/*.ts"]

0 commit comments

Comments
 (0)