from sshtunnel import SSHTunnelForwarder
import os

filename = os.path.basename(__file__)

server = SSHTunnelForwarder(
        ("forward.stines.de", 2223),
        ssh_username="root",
        ssh_password="adm.3dfx12",
        remote_bind_address=('127.0.0.1', 3306)
)

def server_start():
    server.start()
    return print(f"{filename}-Server started")

def server_stop():
    server.stop()
    return print(f"{filename}-Server stoped")

def server_port():
    return server.local_bind_port
