Skip to content

Commit

Permalink
Update 2.3 _worker.js
Browse files Browse the repository at this point in the history
  • Loading branch information
liMilCo authored Dec 8, 2024
1 parent 007c4d6 commit 9e709c5
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions _worker.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,10 @@
export default {
async fetch(request, env) {
try {
const incomingUrl = new URL(request.url);

// Extract port from query parameter or fallback to a default
const incomingPort = incomingUrl.searchParams.get("port") || env.PORT || "443";


const url = new URL(request.url);
url.hostname = env.HOST || 'ictfz.ir';
url.protocol = 'https:';

// Use the incoming port if available, otherwise default to env.PORT or 2096
url.port = incomingPort;

// Forward the modified request
const newRequest = new Request(url, {
method: request.method,
Expand Down

0 comments on commit 9e709c5

Please sign in to comment.