junhoyeo / threads-api

Unofficial, Reverse-Engineered Node.js/TypeScript client for Meta's Threads. Web UI Included.
https://threads.junho.io
MIT License
1.58k stars 134 forks source link

How to use proxy here? #176

Open MsLolita opened 11 months ago

MsLolita commented 11 months ago

For example on python if there is no proxy options I can use such code:

os.environ['http_proxy'] = proxy
os.environ['https_proxy'] = proxy

to pass traffic of the entire application through a proxy. Is there any option to do it here?

Digital39999 commented 11 months ago

You can use proxy by passing it in method options like so:

const client = new ThreadsAPI();

client.getUserIDfromUsername('meta', {
    proxy: {
        host: string;
        port: number;
        auth?: {
                username: string;
                password: string;
        };
        protocol?: string;
    }
});
ttptracker commented 11 months ago

You can use proxy by passing it in method options like so:

const client = new ThreadsAPI();

client.getUserIDfromUsername('meta', {
    proxy: {
        host: string;
        port: number;
        auth?: {
                username: string;
                password: string;
        };
        protocol?: string;
    }
});

I tried writing "socks5", "socks" or "sock" for the protocol. They all return protocol mismatch any idea why? Proxy I'm using is socks5.

Digital39999 commented 11 months ago

I think it's just supposed to be http or https.