-
Notifications
You must be signed in to change notification settings - Fork 9
-
I want to proxy https://poe.com/ , but it was blocked by cloudflare. Somebody knows about it?
from typing import Any
import httpx
import uvicorn
from fastapi_proxy_lib.fastapi.app import reverse_http_app
from httpx import Request
class ModifyHeader(httpx.Auth):
def auth_flow(self, request: httpx.Request) -> Generator[Request, Any, None]:
request.headers["host"] = "poe.com"
request.headers["referer"] = "https://poe.com/"
print(request.headers)
yield request
app = reverse_http_app(
client=httpx.AsyncClient(auth=ModifyHeader()),
base_url="https://poe.com/",
)
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=17788)
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 1 reply
-
This works fine for me. How are you accessing the proxy server? Note that it should not be 0.0.0.0.
Beta Was this translation helpful? Give feedback.
All reactions
1 reply
-
My server IP is not "clean". I tested it on another server and it was fine, just like your screenshot. But on this one was blocked by cloudflare
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment