mirror of
https://github.com/amnezia-vpn/amneziawg-go.git
synced 2025-06-05 04:43:44 +02:00
ipc: add a API to set socketDirectory
The same app installed in Android work profile will use a different cache directory, so I have to allow socketDirectory to be modified at runtime.
This commit is contained in:
parent
e3f1273f8a
commit
5b5b09b1ed
1 changed files with 4 additions and 0 deletions
|
@ -27,6 +27,10 @@ const (
|
||||||
// socketDirectory is variable because it is modified by a linker
|
// socketDirectory is variable because it is modified by a linker
|
||||||
// flag in wireguard-android.
|
// flag in wireguard-android.
|
||||||
var socketDirectory = "/var/run/amneziawg"
|
var socketDirectory = "/var/run/amneziawg"
|
||||||
|
// For android work profile
|
||||||
|
func SetSocketDirectory(directory string) {
|
||||||
|
socketDirectory = directory
|
||||||
|
}
|
||||||
|
|
||||||
func sockPath(iface string) string {
|
func sockPath(iface string) string {
|
||||||
return fmt.Sprintf("%s/%s.sock", socketDirectory, iface)
|
return fmt.Sprintf("%s/%s.sock", socketDirectory, iface)
|
||||||
|
|
Loading…
Add table
Reference in a new issue