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 @@
import time #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import ProxyBuilder as Builder
import ProxyDecoder as Decoder
import ProxyFilter as Filter
import Check as Checker
# ret = Decoder.decode(url) import time
# print(ret) from Builder import Builder
from Basis.Logger import logging
info = { proxy = {
'type': 'hysteria', 'type': 'ss',
'info': {
'server': '127.0.0.1', 'server': '127.0.0.1',
'port': 443, 'port': 12345,
'protocol': 'faketcp', 'passwd': 'dnomd343',
'obfs': '770091573', 'method': 'aes-128-ctr',
'auth': 'dnomd343', 'plugin': None
'sni': 'local.343.re'
} }
}
client = Builder(proxy)
logging.critical(client.id)
logging.critical(client.proxyType)
logging.critical(client.proxyInfo)
logging.critical(client.socksAddr)
logging.critical(client.socksPort)
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