export default {
  async fetch(request, env) {
    const url = new URL(request.url);
    const pt = request.headers.get("Proxy-Authenticate")
    url.host = pt || "testai.cunwuyun.cn"
    return fetch(url, {
      headers: request.headers,
      method: request.method,
      body: request.body,
      redirect: 'follow'
    });
  }
}
