Going for YAML config file
This commit is contained in:
parent
a169009171
commit
3b1c43e101
3 changed files with 18 additions and 10 deletions
|
|
@ -1,5 +0,0 @@
|
||||||
{
|
|
||||||
"service-name":["Description", internal_port, external_port, 'protocol'],
|
|
||||||
"web":["Web HTTP port", 80, 80, 'TCP'],
|
|
||||||
"web-secure":["Web HTTPS port", 443, 443, 'TCP']
|
|
||||||
}
|
|
||||||
17
config.example.yaml
Normal file
17
config.example.yaml
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
wireguard:
|
||||||
|
description: "Wireguard port"
|
||||||
|
internal_port: 51820
|
||||||
|
external_port: 51820
|
||||||
|
protocol: 'UDP'
|
||||||
|
|
||||||
|
transmission-tcp:
|
||||||
|
description: "Transmission TCP peer port"
|
||||||
|
internal_port: 51413
|
||||||
|
external_port: 51413
|
||||||
|
protocol: 'TCP'
|
||||||
|
|
||||||
|
transmission-udp:
|
||||||
|
description: "Transmission UDP peer port"
|
||||||
|
internal_port: 51413
|
||||||
|
external_port: 51413
|
||||||
|
protocol: 'UDP'
|
||||||
|
|
@ -15,10 +15,6 @@ except Exception as e:
|
||||||
print('local ip address :', u.lanaddr)
|
print('local ip address :', u.lanaddr)
|
||||||
print('external ip address :', u.externalipaddress())
|
print('external ip address :', u.externalipaddress())
|
||||||
print( u.statusinfo(), u.connectiontype())
|
print( u.statusinfo(), u.connectiontype())
|
||||||
print('total bytes : sent', u.totalbytesent(), 'received', u.totalbytereceived())
|
|
||||||
print('total packets : sent', u.totalpacketsent(), 'received', u.totalpacketreceived())
|
|
||||||
|
|
||||||
print(u.addportmapping(12000, 'TCP', u.lanaddr, 12000, 'test port mapping', ''))
|
|
||||||
input("Hit any key to interrupt port mapping")
|
|
||||||
print(u.deleteportmapping(12000, 'TCP'))
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue