Skip to content

Instantly share code, notes, and snippets.

@Brramble
Brramble / wg.py
Created April 24, 2023 19:03
wireguard python API
import requests
import argparse
# Change this to your domain name or IP address of server running wg-easy
base_url = 'http://localhost:51821'
# Make sure to update the password to the password you set for your webgui
def get_session_id(base_url=base_url):
path = base_url + '/api/session'
headers = {'Content-Type': 'application/json'}