Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
6Kmfi6HP committed Sep 13, 2024
1 parent c98d3de commit 7af1a07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ async function ProtocolOverWSHandler(request, protocol) {
if (protocol === 'vless') {
processedHeader = processProtocolHeader(chunk, userID);
} else if (protocol === 'trojan') {
processedHeader = await parseTrojanHeader(chunk);
processedHeader = parseTrojanHeader(chunk);
} else {
throw new Error('Invalid protocol');
}
Expand Down Expand Up @@ -852,7 +852,7 @@ function socks5AddressParser(address) {
}


async function parseTrojanHeader(buffer) {
function parseTrojanHeader(buffer) {
if (buffer.byteLength < 58) {
return { hasError: true, message: "Invalid data length" };
}
Expand Down

0 comments on commit 7af1a07

Please sign in to comment.