Browse Source

update: add demo of Builder module

master
dnomd343 3 years ago
parent
commit
116362331d
  1. 49
      demo.py

49
demo.py

@ -1,29 +1,32 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import time import time
from Builder import Builder
from Basis.Logger import logging
import ProxyBuilder as Builder proxy = {
import ProxyDecoder as Decoder 'type': 'ss',
import ProxyFilter as Filter 'info': {
import Check as Checker 'server': '127.0.0.1',
'port': 12345,
'passwd': 'dnomd343',
'method': 'aes-128-ctr',
'plugin': None
}
}
# ret = Decoder.decode(url) client = Builder(proxy)
# print(ret)
info = { logging.critical(client.id)
'type': 'hysteria', logging.critical(client.proxyType)
'server': '127.0.0.1', logging.critical(client.proxyInfo)
'port': 443, logging.critical(client.socksAddr)
'protocol': 'faketcp', logging.critical(client.socksPort)
'obfs': '770091573',
'auth': 'dnomd343',
'sni': 'local.343.re'
}
status, ret = Filter.filte(info, isExtra = True) time.sleep(5)
print(status) logging.critical(client.status())
print(ret)
result = Checker.proxyTest({ client.destroy()
'check': ['http'], logging.critical(client.status())
'info': ret logging.critical('Client output:\n' + str(client.output))
})
print(result)

Loading…
Cancel
Save