Skip to content

Commit

Permalink
change nodejs base image..
Browse files Browse the repository at this point in the history
  • Loading branch information
zizifn committed May 7, 2023
1 parent 871fcc4 commit 930e18e
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 5 deletions.
7 changes: 5 additions & 2 deletions apps/node-vless/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,14 @@ function makeUDPSocketStream(portRemote, address) {
/* … */
udpClient.on('message', (message, info) => {
console.log(
'udp package received',
`udp package received ${info.size} bytes from ${info.address}:${info.port}`,
Buffer.from(message).toString('hex')
);
controller.enqueue(
Buffer.concat([new Uint8Array([0, info.size]), message])
Buffer.concat([
new Uint8Array([(info.size >> 8) & 0xff, info.size & 0xff]),
message,
])
);
});
udpClient.on('error', (error) => {
Expand Down
7 changes: 5 additions & 2 deletions dist/apps/node-vless/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/apps/node-vless/main.js.map

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions typearrat.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

const sizeBuffer = new Uint16Array([356]);

console.log(sizeBuffer);

const int = 356

const test = new Uint8Array([(356 >> 8) & 0xff, 356 & 0xff])

console.log(test);

0 comments on commit 930e18e

Please sign in to comment.