HTTP Fetch Request
# workers-help
m
Hi there whenever I try to make a fetch request to my HTTP website with my cloudfare worker, it returns
error code: 521
c
What are you trying to fetch, exactly? Workers have certain restrictions on outgoing fetches with non-standard ports for example
m
Copy code
js
    async getOrderQueue() {
        return await(await fetch(
            `http://us1.bot-hosting.net:20720/order_queue`,
            {
                method: "GET"
            }
        )).text();
    }
i have to use that port
c
There's a nice flow chart here you can follow
m
ok
c
same-zone means same Cloudflare website, ex only a worker running on bot-hosting.net on a custom domain/route can fetch non-standard ports
m
so i cant request because of its port?
c
yes, you workaround it by adding your own proxy in the middle that your worker calls, ex: Worker -> Your app on a standard port -> non-standard port request, using nginx or something else to proxy the requests also really shouldn't be using insecure http
4 Views