mirror of
https://github.com/masterking32/MasterHttpRelayVPN.git
synced 2026-05-17 21:24:37 +03:00
feat: implement CA certificate serving for LAN devices during sharing
This commit is contained in:
@@ -284,8 +284,23 @@ def main():
|
||||
# print concrete IPv4 addresses users can use on other devices.
|
||||
lan_mode = lan_sharing or listen_host in ("0.0.0.0", "::")
|
||||
if lan_mode:
|
||||
http_port = config.get("http_port", config.get("listen_port", 8080))
|
||||
socks_port = config.get("socks5_port", 1080)
|
||||
log_lan_access(config.get("http_port", config.get("listen_port", 8080)), socks_port)
|
||||
log_lan_access(http_port, socks_port)
|
||||
|
||||
if lan_sharing:
|
||||
# Log CA download URLs so LAN devices know where to get the cert.
|
||||
from core.lan_utils import get_lan_ips
|
||||
ca_urls = [f"http://{addr}/ca.crt" for addr in get_lan_ips(http_port)]
|
||||
if ca_urls:
|
||||
log.info(
|
||||
"CA certificate download (install on other devices): %s",
|
||||
" OR ".join(ca_urls),
|
||||
)
|
||||
else:
|
||||
log.info(
|
||||
"CA certificate download: http://<your-LAN-IP>:%d/ca.crt", http_port
|
||||
)
|
||||
|
||||
try:
|
||||
asyncio.run(_run(config))
|
||||
@@ -293,6 +308,7 @@ def main():
|
||||
log.info("Stopped")
|
||||
|
||||
|
||||
|
||||
def _make_exception_handler(log):
|
||||
"""Return an asyncio exception handler that silences Windows WinError 10054
|
||||
noise from connection cleanup (ConnectionResetError in
|
||||
|
||||
Reference in New Issue
Block a user