mirror of
https://github.com/itdoginfo/podkop.git
synced 2025-12-06 11:36:50 +03:00
Merge branch 'main' into feat/hy2
This commit is contained in:
@@ -87,13 +87,9 @@ trojan://VEetltxLtw@127.0.0.1:59072?type=xhttp&path=%2Fxhttppath&host=google.com
|
|||||||
|
|
||||||
hysteria2://
|
hysteria2://
|
||||||
```
|
```
|
||||||
# Basic (no authentication)
|
|
||||||
hysteria2://127.0.0.1:443/#hysteria2-basic
|
|
||||||
hysteria2://127.0.0.1:443/?insecure=1#hysteria2-basic-insecure
|
|
||||||
|
|
||||||
# With password
|
# With password
|
||||||
hysteria2://password@example.com:443/#hysteria2-password
|
hysteria2://password@example.com:443/#hysteria2-password
|
||||||
hysteria2://password@example.com:443/?insecure=0#hysteria2-password-insecure
|
hysteria2://password@example.com:443/?insecure=1#hysteria2-password-insecure
|
||||||
|
|
||||||
# With SNI
|
# With SNI
|
||||||
hysteria2://password@example.com:443/?sni=example.com#hysteria2-password-sni
|
hysteria2://password@example.com:443/?sni=example.com#hysteria2-password-sni
|
||||||
@@ -102,18 +98,14 @@ hysteria2://password@example.com:443/?sni=example.com#hysteria2-password-sni
|
|||||||
hysteria2://password@example.com:443/?obfs=salamander&obfs-password=obfspassword#hysteria2-obfs
|
hysteria2://password@example.com:443/?obfs=salamander&obfs-password=obfspassword#hysteria2-obfs
|
||||||
|
|
||||||
# All parameters combined
|
# All parameters combined
|
||||||
hysteria2://mypassword@example.com:8443/?sni=example.com&obfs=salamander&obfs-password=obfspass&insecure=0#hysteria2-all-params
|
hysteria2://mypassword@example.com:8443/?sni=example.com&obfs=salamander&obfs-password=obfspass&insecure=1#hysteria2-all-params
|
||||||
```
|
```
|
||||||
|
|
||||||
hy2://
|
hy2://
|
||||||
```
|
```
|
||||||
# Basic (no authentication)
|
|
||||||
hy2://127.0.0.1:443/#hysteria2-basic
|
|
||||||
hy2://127.0.0.1:443/?insecure=1#hysteria2-basic-insecure
|
|
||||||
|
|
||||||
# With password
|
# With password
|
||||||
hy2://password@example.com:443/#hysteria2-password
|
hy2://password@example.com:443/#hysteria2-password
|
||||||
hy2://password@example.com:443/?insecure=0#hysteria2-password-insecure
|
hy2://password@example.com:443/?insecure=1#hysteria2-password-insecure
|
||||||
|
|
||||||
# With SNI
|
# With SNI
|
||||||
hy2://password@example.com:443/?sni=example.com#hysteria2-password-sni
|
hy2://password@example.com:443/?sni=example.com#hysteria2-password-sni
|
||||||
@@ -122,5 +114,5 @@ hy2://password@example.com:443/?sni=example.com#hysteria2-password-sni
|
|||||||
hy2://password@example.com:443/?obfs=salamander&obfs-password=obfspassword#hysteria2-obfs
|
hy2://password@example.com:443/?obfs=salamander&obfs-password=obfspassword#hysteria2-obfs
|
||||||
|
|
||||||
# All parameters combined
|
# All parameters combined
|
||||||
hy2://mypassword@example.com:8443/?sni=example.com&obfs=salamander&obfs-password=obfspass&insecure=0#hysteria2-all-params
|
hy2://mypassword@example.com:8443/?sni=example.com&obfs=salamander&obfs-password=obfspass&insecure=1#hysteria2-all-params
|
||||||
```
|
```
|
||||||
@@ -104,7 +104,7 @@ has_outbound_section() {
|
|||||||
return $section_exists
|
return $section_exists
|
||||||
}
|
}
|
||||||
|
|
||||||
start() {
|
start_main() {
|
||||||
log "Starting podkop"
|
log "Starting podkop"
|
||||||
|
|
||||||
check_requirements
|
check_requirements
|
||||||
@@ -132,24 +132,13 @@ start() {
|
|||||||
sing_box_init_config
|
sing_box_init_config
|
||||||
config_foreach add_cron_job "section"
|
config_foreach add_cron_job "section"
|
||||||
/etc/init.d/sing-box start
|
/etc/init.d/sing-box start
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "Failed to start sing-box service"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0
|
|
||||||
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
|
||||||
dnsmasq_configure
|
|
||||||
fi
|
|
||||||
uci_set "podkop" "settings" "shutdown_correctly" 0
|
|
||||||
uci commit "podkop" && config_load "$PODKOP_CONFIG"
|
|
||||||
|
|
||||||
log "Nice"
|
log "Nice"
|
||||||
list_update &
|
list_update &
|
||||||
echo $! > /var/run/podkop_list_update.pid
|
echo $! > /var/run/podkop_list_update.pid
|
||||||
}
|
}
|
||||||
|
|
||||||
stop() {
|
stop_main() {
|
||||||
log "Stopping the podkop"
|
log "Stopping the podkop"
|
||||||
|
|
||||||
if [ -f /var/run/podkop_list_update.pid ]; then
|
if [ -f /var/run/podkop_list_update.pid ]; then
|
||||||
@@ -180,14 +169,30 @@ stop() {
|
|||||||
ip route flush table podkop
|
ip route flush table podkop
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
log "Stop sing-box"
|
||||||
|
/etc/init.d/sing-box stop
|
||||||
|
}
|
||||||
|
|
||||||
|
start() {
|
||||||
|
start_main
|
||||||
|
|
||||||
|
config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0
|
||||||
|
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
||||||
|
dnsmasq_configure
|
||||||
|
fi
|
||||||
|
|
||||||
|
uci_set "podkop" "settings" "shutdown_correctly" 0
|
||||||
|
uci commit "podkop" && config_load "$PODKOP_CONFIG"
|
||||||
|
}
|
||||||
|
|
||||||
|
stop() {
|
||||||
local dont_touch_dhcp
|
local dont_touch_dhcp
|
||||||
config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0
|
config_get_bool dont_touch_dhcp "settings" "dont_touch_dhcp" 0
|
||||||
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
if [ "$dont_touch_dhcp" -eq 0 ]; then
|
||||||
dnsmasq_restore
|
dnsmasq_restore
|
||||||
fi
|
fi
|
||||||
|
|
||||||
log "Stop sing-box"
|
stop_main
|
||||||
/etc/init.d/sing-box stop
|
|
||||||
|
|
||||||
uci_set "podkop" "settings" "shutdown_correctly" 1
|
uci_set "podkop" "settings" "shutdown_correctly" 1
|
||||||
uci commit "podkop" && config_load "$PODKOP_CONFIG"
|
uci commit "podkop" && config_load "$PODKOP_CONFIG"
|
||||||
@@ -195,8 +200,8 @@ stop() {
|
|||||||
|
|
||||||
reload() {
|
reload() {
|
||||||
log "Podkop reload"
|
log "Podkop reload"
|
||||||
stop
|
stop_main
|
||||||
start
|
start_main
|
||||||
}
|
}
|
||||||
|
|
||||||
restart() {
|
restart() {
|
||||||
|
|||||||
Reference in New Issue
Block a user