Fetch HTML
  Last reviewed:  almost 2 years ago  
  Send a request to a remote server, read HTML from the response, and serve that HTML.
If you want to get started quickly, click on the button below.
This creates a repository in your GitHub account and deploys the application to Cloudflare Workers.
export default {  async fetch(request) {    /**     * Replace `remote` with the host you wish to send requests to     */    const remote = "https://example.com";
    return await fetch(remote, request);  },};export default {  async fetch(request: Request): Promise<Response> {    /**     * Replace `remote` with the host you wish to send requests to     */    const remote = "https://example.com";
    return await fetch(remote, request);  },};from workers import WorkerEntrypointfrom js import fetch
class Default(WorkerEntrypoint):    async def fetch(self, request):        # Replace `remote` with the host you wish to send requests to        remote = "https://example.com"        return await fetch(remote, request)import { Hono } from "hono";
const app = new Hono();
app.all("*", async (c) => {  /**   * Replace `remote` with the host you wish to send requests to   */  const remote = "https://example.com";
  // Forward the request to the remote server  return await fetch(remote, c.req.raw);});
export default app;Was this helpful?
- Resources
 - API
 - New to Cloudflare?
 - Directory
 - Sponsorships
 - Open Source
 
- Support
 - Help Center
 - System Status
 - Compliance
 - GDPR
 
- Company
 - cloudflare.com
 - Our team
 - Careers
 
- © 2025 Cloudflare, Inc.
 - Privacy Policy
 - Terms of Use
 - Report Security Issues
 - Trademark