This commit is contained in:
zizifn
2022-12-06 02:26:47 +08:00
committed by zizifn
parent 45150af5f4
commit ee1d43d8cf
3 changed files with 16 additions and 9 deletions

View File

@@ -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'

View File

@@ -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"]
},

View File

@@ -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);