跳转到内容
搜索文档

获取 HTML

向远程服务器发送请求,读取响应中的 HTML 并提供服务。 serve that HTML.

最后更新 查看 MarkdownAgent 设置

如需快速上手,请点击下方按钮。

Deploy to Cloudflare

这会在你的 GitHub 账户中创建仓库,并将应用部署到 Cloudflare Workers。

export default {
  async fetch(request) {
    /**
     * 将 `remote` 替换为您希望向其发送请求的主机
     */
    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 WorkerEntrypoint
from 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;

这篇文档对您有帮助吗?