1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
# Functions
## Creating the class
See [Overview](../overview/registering.html)
This creates the class and basically forwards these arguments when `register` is called.
```python
def __init__(self, name: str, directory: str)
```
- `name`: The name of the client
- `directory`: The directory where the configs and logging should be stored
## Registering
See [Overview](../overview/registering.html)
```python
def register(self, debug=False: bool) -> Optional[str]
```
- `debug`: Whether or not we want to enable debugging
Returns an optional `string` for the error message
## Discovery
See [Overview](../overview/discovery.html)
```python
def get_disco_servers(self) -> (Optional[str], Optional[str])
```
```python
def get_disco_organizations(self) -> (Optional[str], Optional[str])
```
Returns an optional `string` of JSON data with the servers/organizations and an optional error message
## OpenVPN/Wireguard config
See [Overview](../overview/getconfig.html)
```python
def get_connect_config(self, url: str, forceTCP: bool) -> (Optional[str], Optional[str], Optional[str])
```
- `url`: The url of the server to get a connect config for
- `forceTCP`: Whether or not we want to force enable TCP
Returns:
- An optional `string` of the OpenVPN/Wireguard config
- An optional `string`, `openvpn` or `wireguard` indicating if it is an OpenVPN or Wireguard config
- An optional error message `string`
### Setting a profile ID
```python
def set_profile(self, profile_id: str) -> Optional[str]
```
- `profile_id`: The profile ID to connect to
Returns an optional `string`, which is the error message
## Connecting/Disconnecting
See [Overview](../overview/connecting.html)
```python
def set_connected(self) -> Optional[str]
```
```python
def set_disconnected(self) -> Optional[str]
```
Returns an optional `string`, which is the error message
## Deregister
See [Overview](../overview/deregistering.html)
```python
def deregister() -> Optional[str]
```
Returns an optional `string`, which is the error message
|