Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

outline-vpn-api-async

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

outline-vpn-api-async

Async Python API wrapper for Outline VPN

  • 0.1.2
  • PyPI
  • Socket score

Maintainers
1

outline-vpn-api-async

A Python API wrapper for Outline VPN

This is a fork of https://github.com/jadolg/outline-vpn-api

Test

How to use

from outline_vpn import OutlineVPN

async def main():
    # Setup the access with the API URL (Use the one provided to you after the server setup)
    client = OutlineVPN(api_url="https://127.0.0.1:51083/xlUG4F5BBft4rSrIvDSWuw")
    # Init the client with setting cert_sha256
    await client.init(cert_sha256="4EFF7BB90BCE5D4A172D338DC91B5B9975E197E39E3FA4FC42353763C4E58765")
    
    # Get all access URLs on the server
    for key in await client.get_keys():
        print(key.access_url)
    
    # Get a single key by it id
    my_cool_key = await client.get_key(key_id=1337)
    print(my_cool_key.access_url)
    
    # Create a new key
    new_key = await client.create_key()
    
    # [Optional] You can set a name to key while creating it to auto rename
    new_key = await client.create_key(key_name="My cool key")
    
    # Rename it
    await client.rename_key(key_id=new_key.key_id, name="new_key")
    
    # Delete it
    await client.delete_key(key_id=new_key.key_id)
    
    # Set a monthly data limit for a key (20MB)
    await client.add_data_limit(key_id=new_key.key_id, limit_bytes=1000 * 1000 * 20)
    
    # Remove the data limit
    await client.delete_data_limit(key_id=new_key.key_id)

    
if __name__ == "__main__":
    import asyncio
    asyncio.run(main())

Contribution

Install locally

pip install -e .

Fill out test.env with your test server creds

cp test.env.example test.env

Run tests

pytest

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc