Set proxy and user agent with external libraries?

i’m sorry for not adding more details. This is a post where i’ve described the problem as detailed as possible: