Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

proxies

Marcel Kloubert edited this page Mar 13, 2018 · 20 revisions

Home >> Settings >> Proxies

Proxies

You can define one or more TCP proxies, which transfer data between two endpoints.

This is useful, if someone owns a VPN connection and wants to share it.

The following example starts a proxy at local port 2222 and sends all data between it and example.com:22.
Additionally access is stricted to IPs of 192.168.0.0/24 (IPv4) and 0:0:0:0:0:FFFF:C0A8:0000/24 (IPv6).

{
    "deploy.reloaded": {
        "proxies": {
            "2222": {
                "name": "My proxy",
                "description": "This proxy listens on port ${proxyPort}",
                
                "allowed": [
                    "0:0:0:0:0:FFFF:C0A8:0000/24",
                    "192.168.0.0/24"
                ],
                
                "destination": "example.com:22",
            }
        }
    }
}

Settings

Destination address (string)

The following example will start a proxy at port 21 and uses example.com:21 as target address.

{
    "deploy.reloaded": {
        "proxies": {
            "21": "example.com:21"
        }
    }
}

Destination port on local machine (number)

The following example will start a proxy at port 2222 and transfers data between it and the service, which listens on port 22 on the local machine.

{
    "deploy.reloaded": {
        "proxies": {
            "2222": 22
        }
    }
}

As object

Name Description
allowed One or more allowed IPs in CIDR format. Default: All IPs are allowed.
autoStart Run proxy on startup. Default: (true)
button Settings for a button. Default: (true)
debug Enable logging or not (s. .vscode-deploy-reloaded sub folder inside the user's home directory). Default: (false)
description* A description for the proxy.
destination* The destination.
if One or more conditions (as JavaScript code) that defines if proxy is available or not, similar to values.
name* The (display) name of the proxy.
platforms One or more platform names the proxy is for. s. process.platform

* supports placeholders

Buttons

As text (string)

Defines the display text of the button.

{
    "deploy.reloaded": {
        "proxies": {
            "22": {
                "name": "My proxy",
                "button": "${proxyStateIcon} Proxy '${proxy}' @ port ${proxyPort}",

                // ...
            }
        }
    }
}
As boolean

Indicates if a button should be enabled or not.

{
    "deploy.reloaded": {
        "proxies": {
            "22": {
                "button": false,

                // ...
            }
        }
    }
}
As object
Name Description
color The custom (text) color when the proxy is running.
enabled Enable button or not. Default: (true)
isRight Put button on the right side or not. Default: (false)
priority The priority.
stopColor The custom (text) color when the proxy is NOT running.
text* The custom display text.
tooltip* The custom tooltip text.

* supports placeholders

Additional values

The following placeholders are also supported:

Name Description
proxy The display name of the underlying proxy.
proxyPort The TCP port the proxy listens on.
proxyStateIcon The state icon. Can be $(triangle-right) (running) or $(primitive-square) (not running).

Destination

As port value
{
    "deploy.reloaded": {
        "proxies": {
            "2121": {
                "destination": 21
            }
        }
    }
}
Address with optional port
{
    "deploy.reloaded": {
        "proxies": {
            "22": {
                "destination": "example.com:${proxyPort}"
            }
        }
    }
}

The following placeholders are also supported:

Name Description
proxyPort The TCP port the proxy listens on.
As object
{
    "deploy.reloaded": {
        "proxies": {
            "2222": {
                "destination": {
                    "address": "example.com",
                    "port": 22
                }
            }
        }
    }
}

Additional values

The following placeholders are also supported for name and description, e.g.:

Name Description
proxyPort The TCP port the proxy listens on.