Automatic Proxy

I want to use proxy with nyxt and also want to switch it per URL. Is there any way to do it in nyxt?

Not sure if I can help, I am new to Nyxt. I have never used proxy before.

But I will try :slight_smile:

Could you give me more details about what exactly are you willing to do?

For instance, the description of the proxy-mode presents a definition and provides a use case example with Tor:

PROXY-MODE (NYXT/PROXY-MODE)

Enable forwarding of all network requests to a specific host.
As for every mode, it only applies to the current buffer. If you want to enable
a proxy for all buffers, add it to the list of default modes.

Example to use Tor as a proxy both for browsing and downloading:

(define-configuration nyxt/proxy-mode:proxy-mode
  ((nyxt/proxy-mode:proxy (make-instance 'proxy
                                         :url (quri:uri "socks5://localhost:9050")
                                         :allowlist '("localhost" "localhost:8080")
                                         :proxied-downloads-p t))))

(define-configuration buffer
  ((default-modes (append '(proxy-mode) %slot-default%))))
1 Like

Thanks, I think you find what I want :+1:. just one another thing that I want to use proxy mode on specific URLs automatically for example when I open google.com, I want to use proxy mode but when I open bing.com I don’t want to use proxy mode.

1 Like

This is what PAC files are for.

Does Nyxt not support PAC files?

There is in fact a way to do this, take a look at auto mode:

https://nyxt.atlas.engineer/article/auto-mode.org

It can do a lot more too :slight_smile:

1 Like

Yes exactly the PAC file is okay but the proposed solution does the same for me. Thanks for your answers.

I am start using the auto-mode and it works great. I want to share my configuration between my systems and I want to ask is there any way to load the auto-mode file from the ~/.config directory?

Of course :slight_smile:
customize the auto-mode-rules-path to suit your needs!