Библиотека для работы с wireguard
Project description
wireguard
Описание
Библиотека для работы с wireguard
Installation
python3 -m pip install wireguard-lib
Пример использования:
Сгенерируем конфиг сервера.
Для этого нужен приватный ключ.
Воспользуемся консолью Python для получения приватного ключа:
>>> from wireguard import Wireguard
>>> Wireguard().get_private_key
'sBd8jkAY9Ht7wn+q5iGbW4MfShgjdxB1s3oTJsttaHc='
Используя полученый ключ сгенерируем конфиг сервера:
from wireguard import Wireguard
wg = Wireguard(
server_private_key = 'sBd8jkAY9Ht7wn+q5iGbW4MfShgjdxB1s3oTJsttaHc=',
server_addres='wireguard.example.org',
server_ip='10.10.10.1',
server_port=51821,
)
server_config = wg.get_config_server
print(server_config)
Получим следующий конфиг:
[Interface]
PrivateKey = sBd8jkAY9Ht7wn+q5iGbW4MfShgjdxB1s3oTJsttaHc=
Address = 10.10.10.1
ListenPort = 51821
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
wireguard-lib-0.1.10.tar.gz
(5.1 kB
view details)
Built Distribution
File details
Details for the file wireguard-lib-0.1.10.tar.gz
.
File metadata
- Download URL: wireguard-lib-0.1.10.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fa02f8c854fba0ea04c476553b23f937a4b4ede58046b662e59e7a713af69dc |
|
MD5 | 1a261a7e204032c84aea8b38229fe848 |
|
BLAKE2b-256 | 9ffd295902c6e0c95e65e2dbacdbac287a5878be54ee74212cea97274c7c6591 |
File details
Details for the file wireguard_lib-0.1.10-py3-none-any.whl
.
File metadata
- Download URL: wireguard_lib-0.1.10-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 89e80d3fcb36816f0515c1c28f26e9a6954c47567db41bb374078626252718d5 |
|
MD5 | 4233c4b436b8fc83bc2684d10f7c028f |
|
BLAKE2b-256 | 4eddc04d4cdcb3dcd4e68171d2657e078f6b63d610f29e35c6bedc4dd6691d2a |