Module proxy
Dynamic proxy settings
This module offers a simple and convenient user interface for using a proxy while browsing the web. Users can add entries for specific proxy addresses, and easily switch between using any of these proxies to redirect traffic. It is also possible to use the system proxy, or disable proxy use altogether.
Adding a new proxy entry
To add a new proxy entry, use the :proxy
command, with the name of the
proxy and the web address of the proxy as arguments::proxy <name> <address>
.
Example
To add a proxy entry for a local proxy running on port 8000, run the following:
:proxy proxy-name socks://localhost:8000
Viewing and changing the current proxy
It is currently easiest to view the current proxy by opening the proxy menu
with the :proxy
command. The current proxy will be shown in black text, while any
inactive proxies will be shown in light gray text.
Functions
proxy.get_names ()
Get an ordered list of proxy names.
Return Values
-
tableList of proxy names.
proxy.get (name)
Get the address of proxy given by name.
Parameters
-
nameType: stringThe name of a proxy.
Return Values
-
stringThe address of the proxy.
proxy.get_active ()
Get the active proxy configuration.
Return Values
-
tableThe active proxy configuration. Two fields are present:
name
andaddress
.
proxy.load (fd_name)
Load the proxies list from a file.
Parameters
-
fd_nameType: stringCustom proxy storage or
nil
to use default.
proxy.save (fd_name)
Save the proxies list to a file.
Parameters
-
fd_nameType: stringCustom proxy storage or
nil
to use default.
proxy.set (name, address, save_file)
Add a new proxy server to current list.
Parameters
-
nameType: stringProxy configuration name.
-
addressType: stringProxy server address.
-
save_fileType: booleanDo not save configuration if
false
.
proxy.del (name)
Delete a proxy from the proxy list.
Parameters
-
nameType: stringProxy server name.
proxy.set_active (name)
Set given proxy to active. Return true on success, else false.
Parameters
-
nameType: stringProxy configuration name or
nil
to unset proxy.
Attribution
Copyright
- Piotr Husiatyński