-
Notifications
You must be signed in to change notification settings - Fork 0
edge proxy
this is an optional feature that allows routing some extractor requests through a custom proxy endpoint, instead of a classic http(s)/socks5 proxy. this is useful if you want to centralize or control the traffic of certain platforms via your own proxy service, for example to bypass geo-restrictions, add caching, logging, or other customizations.
unlike a traditional proxy that forwards raw http requests, an edge proxy acts as a middleware that:
- receives the request from the user
- performs the same request on behalf of the user
- returns the response in a standardized json format
this allows you to add custom logic such as caching, logging, rate limiting, or geo-restriction bypassing.
edge proxy is configured via the private/config.yaml file. you can set the proxy url for each extractor that supports it:
instagram:
edge_proxy: https://your-edge-proxy. com
tiktok:
edge_proxy: https://your-edge-proxy.comyou can also combine it with other options:
reddit:
edge_proxy: https://your-edge-proxy.com
impersonate: truethe edge proxy must respond with a json object in the following format:
{
"url": "https://example.com/resource",
"status_code": 200,
"text": "response body",
"headers": {
"Content-Type": "application/json"
},
"cookies": [
"cookie1=value1; Path=/; HttpOnly",
"cookie2=value2; Path=/"
]
}| field | type | description |
|---|---|---|
url |
string |
the final url after any redirects |
status_code |
int |
the http status code of the response |
text |
string |
the response body as a string |
headers |
object |
a key-value map of response headers |
cookies |
[]string |
a list of set-cookie header values |
for the full implementation, see the networking.EdgeProxyResponse model.
- this feature is experimental and may change in the future
- you are responsible for implementing and hosting your own edge proxy service
- see the
networkingpackage for the full implementation details