openbullet / OpenBullet2

OpenBullet reinvented
https://docs.openbullet.dev/
MIT License
1.79k stars 479 forks source link

[REQUEST] Custom Proxy for Request Block #346

Closed APT-ZERO closed 3 years ago

APT-ZERO commented 3 years ago

Add 'Proxy Type / IP / PORT / Proxy Auth Creds' in Request Block

APT-ZERO commented 3 years ago

good if you add three option inside request block :

openbullet commented 3 years ago

https://discourse.openbullet.dev/t/setting-a-temporary-proxy/1728

APT-ZERO commented 3 years ago

@openbullet i tried that and also this one : https://discourse.openbullet.dev/t/add-block-use-proxy-and-other-block-proxyless/921/3

But none of them works, can you test yourself, and paste the lolicode?

openbullet commented 3 years ago

Everything works correctly, please write your LoliCode so I can see what you're doing wrong.

APT-ZERO commented 3 years ago

@openbullet i just pasted your code image image https://discourse.openbullet.dev/t/setting-a-temporary-proxy/1728

APT-ZERO commented 3 years ago

image image https://discourse.openbullet.dev/t/add-block-use-proxy-and-other-block-proxyless/921/3

openbullet commented 3 years ago

Replace ProxyType with RuriLib.Models.Proxies.ProxyType. This error happens because you don't have the namespace RuriLib.Models.Proxies imported above in the "usings" section. Also remember to properly set up the port, username and password when you run otherwise nothing will work ^^

APT-ZERO commented 3 years ago

@openbullet still not works :'( image

openbullet commented 3 years ago

Because you started without a proxy. This code is only to change the proxy if you already have one. If you don't have a proxy you have to use the other code

data.Proxy = new RuriLib.Models.Proxies.Proxy("127.0.0.1", 9050, RuriLib.Models.Proxies.ProxyType.Socks5, "username", "password");
data.UseProxy = true;

// Here put the request block

data.UseProxy = false;

If you want me to add some syntax sugar for LoliCode to do this because you don't want to use C# then open a separate issue.

APT-ZERO commented 3 years ago

Finally... problem solved thank you