diff --git a/app/utils/share.py b/app/utils/share.py index 259f781..718596d 100644 --- a/app/utils/share.py +++ b/app/utils/share.py @@ -14,9 +14,9 @@ from app.db import GetDB, crud from app.models.proxy import ( InboundHostSecurity, ) +from app.models.user import UserStatus from app.utils.keygen import gen_uuid, gen_password from app.utils.system import get_public_ip, readable_size -from app.models.user import UserStatus if TYPE_CHECKING: from app.models.user import UserResponse @@ -197,13 +197,17 @@ def process_inbounds_and_tags( sni=sni, host=req_host, tls=host_tls or inbound["tls"], + header_type=inbound.get("header_type"), alpn=host.alpn.value or None, path=( host.path.format_map(format_variables) if host.path else inbound.get("path") ), - fingerprint=host.fingerprint.value, + fingerprint=host.fingerprint.value or inbound.get("fp"), + reality_pbk=inbound.get("pbk"), + reality_sid=inbound.get("sid"), + flow=inbound.get("flow"), allow_insecure=host.allowinsecure, uuid=UUID(gen_uuid(key)), password=gen_password(key), diff --git a/app/utils/store.py b/app/utils/store.py deleted file mode 100644 index 077683b..0000000 --- a/app/utils/store.py +++ /dev/null @@ -1,87 +0,0 @@ -class MemoryStorage: - def __init__(self): - self._data = {} - - def set(self, key, value): - self._data[key] = value - - def get(self, key, default=None): - return self._data.get(key, default) - - def delete(self, key): - self._data.pop(key, None) - - def clear(self): - self._data.clear() - - -class ListStorage(list): - def __init__(self, update_func): - super().__init__() - self.update_func = update_func - - def __getitem__(self, index): - if not self: - self.update() - - return super().__getitem__(index) - - def __iter__(self): - if not self: - self.update() - - return super().__iter__() - - def __str__(self): - if not self: - self.update() - - return super().__str__() - - def update(self): - self.update_func(self) - - -class DictStorage(dict): - def __init__(self, update_func): - super().__init__() - self.update_func = update_func - - def __getitem__(self, key): - if not self: - self.update() - - return super().__getitem__(key) - - def __iter__(self): - if not self: - self.update() - - return super().__iter__() - - def __str__(self): - if not self: - self.update() - - return super().__str__() - - def values(self): - if not self: - self.update() - - return super().values() - - def keys(self): - if not self: - self.update() - - return super().keys() - - def get(self, key, default=None): - if not self: - self.update() - - return super().get(key, default) - - def update(self): - self.update_func(self)