@@ -17,16 +17,13 @@ const invocRequestEmitter = new EventEmitter();
1717
1818export async function waitForProxyRequest ( invocationId : string ) : Promise < http . IncomingMessage > {
1919 return new Promise ( ( resolve , _reject ) => {
20- workerSystemLog ( 'debug' , 'Waiting for proxy request' , { invocationId } ) ;
2120 const req = requests [ invocationId ] ;
2221 if ( req ) {
2322 resolve ( req ) ;
24- workerSystemLog ( 'debug' , 'Proxy request found' , { invocationId } ) ;
2523 delete requests [ invocationId ] ;
2624 } else {
2725 invocRequestEmitter . once ( invocationId , ( ) => {
2826 const req = requests [ invocationId ] ;
29- workerSystemLog ( 'debug' , 'Proxy request else statement' ) ;
3027 if ( req ) {
3128 resolve ( req ) ;
3229 delete requests [ invocationId ] ;
@@ -38,13 +35,11 @@ export async function waitForProxyRequest(invocationId: string): Promise<http.In
3835
3936const invocationIdHeader = 'x-ms-invocation-id' ;
4037export async function sendProxyResponse ( invocationId : string , userRes : HttpResponse ) : Promise < void > {
41- workerSystemLog ( 'debug' , 'Sending proxy response' , { invocationId } ) ;
4238 const proxyRes = nonNullProp ( responses , invocationId ) ;
4339 delete responses [ invocationId ] ;
4440 for ( const [ key , val ] of userRes . headers . entries ( ) ) {
4541 proxyRes . setHeader ( key , val ) ;
4642 }
47- workerSystemLog ( 'debug' , 'Http proxy headers set' ) ;
4843 proxyRes . setHeader ( invocationIdHeader , invocationId ) ;
4944 proxyRes . statusCode = userRes . status ;
5045
@@ -54,9 +49,7 @@ export async function sendProxyResponse(invocationId: string, userRes: HttpRespo
5449
5550 if ( userRes . body ) {
5651 for await ( const chunk of userRes . body . values ( ) ) {
57- workerSystemLog ( 'debug' , 'Writing proxy response chunk' ) ;
5852 proxyRes . write ( chunk ) ;
59- workerSystemLog ( 'debug' , 'Http proxy response chunks written' ) ;
6053 }
6154 }
6255 proxyRes . end ( ) ;
@@ -94,12 +87,10 @@ function setCookies(userRes: HttpResponse, proxyRes: http.ServerResponse): void
9487export async function setupHttpProxy ( ) : Promise < string > {
9588 return new Promise ( ( resolve , reject ) => {
9689 const server = http . createServer ( ) ;
97- workerSystemLog ( 'debug' , 'Http proxy server created' ) ;
9890
9991 server . on ( 'request' , ( req , res ) => {
10092 const invocationId = req . headers [ invocationIdHeader ] ;
10193 if ( typeof invocationId === 'string' ) {
102- workerSystemLog ( 'debug' , 'Http proxy request received' , { invocationId } ) ;
10394 requests [ invocationId ] = req ;
10495 responses [ invocationId ] = res ;
10596 invocRequestEmitter . emit ( invocationId ) ;
0 commit comments