Skip to main content

Библиотека для работы с 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

MIT License (MIT)

Project details


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)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

wireguard_lib-0.1.10-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

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

Hashes for wireguard-lib-0.1.10.tar.gz
Algorithm Hash digest
SHA256 8fa02f8c854fba0ea04c476553b23f937a4b4ede58046b662e59e7a713af69dc
MD5 1a261a7e204032c84aea8b38229fe848
BLAKE2b-256 9ffd295902c6e0c95e65e2dbacdbac287a5878be54ee74212cea97274c7c6591

See more details on using hashes here.

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

Hashes for wireguard_lib-0.1.10-py3-none-any.whl
Algorithm Hash digest
SHA256 89e80d3fcb36816f0515c1c28f26e9a6954c47567db41bb374078626252718d5
MD5 4233c4b436b8fc83bc2684d10f7c028f
BLAKE2b-256 4eddc04d4cdcb3dcd4e68171d2657e078f6b63d610f29e35c6bedc4dd6691d2a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page