From ee1d43d8cf638390d800a93a1649f698ea6a8e27 Mon Sep 17 00:00:00 2001 From: zizifn <1803942+zizifn@users.noreply.github.com> Date: Tue, 6 Dec 2022 02:26:47 +0800 Subject: [PATCH] hot fix --- .github/workflows/release.yml | 8 ++++---- apps/edge-bypass-client/project.json | 9 ++++++++- apps/edge-bypass-client/src/main.ts | 8 ++++---- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8ce89b..056c706 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,13 +20,13 @@ jobs: - name: copy config file run: cp dist/apps/edge-bypass-client/assets/config.json dist/pkg/edge-tunnel-client - name: zip edgetunnel-linux-arm64 - run: zip -j edgetunnel-linux-arm64-${{github.GITHUB_RUN_NUMBER}}.zip dist/pkg/edge-tunnel-client/edgetunnel-linux-arm64 dist/pkg/edge-tunnel-client/config.json + run: zip -j edgetunnel-linux-arm64-${{github.run_number}}.zip dist/pkg/edge-tunnel-client/edgetunnel-linux-arm64 dist/pkg/edge-tunnel-client/config.json - name: zip edgetunnel-linux-x64 - run: zip -j edgetunnel-linux-x64-${{github.GITHUB_RUN_NUMBER}}.zip dist/pkg/edge-tunnel-client/edgetunnel-linux-x64 dist/pkg/edge-tunnel-client/config.json + run: zip -j edgetunnel-linux-x64-${{github.run_number}}.zip dist/pkg/edge-tunnel-client/edgetunnel-linux-x64 dist/pkg/edge-tunnel-client/config.json - name: zip edgetunnel-macos-x64 - run: zip -j edgetunnel-macos-x64-${{github.GITHUB_RUN_NUMBER}}.zip dist/pkg/edge-tunnel-client/edgetunnel-macos-x64 dist/pkg/edge-tunnel-client/config.json + run: zip -j edgetunnel-macos-x64-${{github.run_number}}.zip dist/pkg/edge-tunnel-client/edgetunnel-macos-x64 dist/pkg/edge-tunnel-client/config.json - name: zip edgetunnel-win-x64 - run: zip -j edgetunnel-win-x64-${{github.GITHUB_RUN_NUMBER}}.zip dist/pkg/edge-tunnel-client/edgetunnel-win-x64.exe dist/pkg/edge-tunnel-client/config.json + run: zip -j edgetunnel-win-x64-${{github.run_number}}.zip dist/pkg/edge-tunnel-client/edgetunnel-win-x64.exe dist/pkg/edge-tunnel-client/config.json - name: Upload release files uses: svenstaro/upload-release-action@v2 if: github.event_name == 'release' diff --git a/apps/edge-bypass-client/project.json b/apps/edge-bypass-client/project.json index 52e6ec9..d19cc9d 100644 --- a/apps/edge-bypass-client/project.json +++ b/apps/edge-bypass-client/project.json @@ -48,7 +48,14 @@ "pkg": { "executor": "nx:run-commands", "options": { - "command": "npx pkg dist/apps/edge-bypass-client/main.js --targets win --compress GZip --output dist/pkg/edge-tunnel-client/edgetunnel" + "command": "npx pkg dist/apps/edge-bypass-client/main.js --targets linux,linux-arm64,macos,win --compress GZip --output dist/pkg/edge-tunnel-client/edgetunnel" + }, + "dependsOn": ["build"] + }, + "pkg-local": { + "executor": "nx:run-commands", + "options": { + "command": "npx pkg dist/apps/edge-bypass-client/main.js --targets win --compress GZip --output dist/pkg/edge-tunnel-client/edgetunnel" }, "dependsOn": ["build"] }, diff --git a/apps/edge-bypass-client/src/main.ts b/apps/edge-bypass-client/src/main.ts index 325c7fc..66eddda 100644 --- a/apps/edge-bypass-client/src/main.ts +++ b/apps/edge-bypass-client/src/main.ts @@ -14,9 +14,7 @@ const httpProxyServer = createServer(async (req, resp) => { const reqUrl = url.parse(req.url); const clientSocketLoggerInfo = `[proxy to ${req.url}(http)]`; try { - console.log( - `Client Connected To Proxy, client http version is ${req.httpVersion}, ${clientSocketLoggerInfo}}` - ); + console.log(`${clientSocketLoggerInfo} Client use HTTP/${req.httpVersion}`); // make call to edge http server // 1. forward all package remote, socket over http body const { body, headers, statusCode, trailers } = await undici.request( @@ -33,7 +31,9 @@ const httpProxyServer = createServer(async (req, resp) => { body: Readable.from(rawHTTPPackageWithDelay(req)), } ); - console.log(`${clientSocketLoggerInfo} remote server return ${statusCode}`); + console.log( + `${clientSocketLoggerInfo} remote server return ${statusCode} Connected To Proxy` + ); // 2. forward remote reponse body to clientSocket for await (const chunk of body) { req.socket.write(chunk);