Skip to content

Commit

Permalink
save
Browse files Browse the repository at this point in the history
  • Loading branch information
schettn committed Jun 28, 2024
1 parent b6c6f34 commit 66499cc
Showing 1 changed file with 0 additions and 10 deletions.
10 changes: 0 additions & 10 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
function basicProxy(proxy_url = ""): Handler {
console.log("Proxying to", proxy_url);
return async (c: Context) => {
// log host header
console.log("Host", c.req.header("host"));

// remove prefix
// prefix = /app1/*, path = /app1/a/b
// => suffix_path = /a/b
Expand Down Expand Up @@ -60,7 +57,6 @@ function basicProxy(proxy_url = ""): Handler {

const fetchAndHandleBunCertificateError = async (): Promise<Response> => {
try {
console.log("fetchAndHandleBunCertificateError: Fetching", url);
return await fetch(url, {
method: c.req.raw.method,
headers: { ...headers, host: undefined },
Expand Down Expand Up @@ -110,8 +106,6 @@ function basicProxy(proxy_url = ""): Handler {

let compressed: ArrayBuffer;

console.log("Content-Encoding", contentEncoding);

if (contentEncoding === "deflate") {
const buffer = await response.arrayBuffer();
compressed = Bun.deflateSync(buffer).buffer as ArrayBuffer;
Expand Down Expand Up @@ -225,8 +219,6 @@ export const configureApp: PylonAPI["configureApp"] = async (app) => {
};

targetWs.onmessage = async (event) => {
console.log("Target WebSocket message received", event.data);

ws.send(event.data.toString());
};

Expand All @@ -236,7 +228,6 @@ export const configureApp: PylonAPI["configureApp"] = async (app) => {
};
},
onMessage: (event, ws) => {
console.log("Message received", event.data.toString());
if (targetWs) {
targetWs.send(event.data.toString());
} else {
Expand All @@ -254,7 +245,6 @@ export const configureApp: PylonAPI["configureApp"] = async (app) => {
);

app.use(async (c, next) => {
console.log("Request", c.req.url);
const subdomains = getSubdomains(c.req.url);

const serviceId = subdomains[subdomains.length - 1];
Expand Down

0 comments on commit 66499cc

Please sign in to comment.