Skip to content

Commit

Permalink
Update worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
felixzhang-glitch authored Nov 24, 2024
1 parent 64dd276 commit ff4a25f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,7 @@ const worker_default = {

switch (url.pathname) {
case "/link": {
// Optional password protection for `/link` endpoint
const linkPassword = "your-link-password"; // Replace this with your secure password
if (url.searchParams.get("key") !== linkPassword) {
return new Response("Forbidden", { status: 403 });
}

// Remove password protection
const host = request.headers.get('Host');
return new Response(
`trojan://ca110us@${host}:443/?type=ws&host=${host}&security=tls`,
Expand Down

0 comments on commit ff4a25f

Please sign in to comment.