mirror of
https://github.com/whyvl/wireproxy.git
synced 2025-04-29 19:01:42 +02:00
fix config parsing
This commit is contained in:
parent
e749217090
commit
ff99bfd4a6
3 changed files with 100 additions and 9 deletions
|
@ -20,8 +20,8 @@ type DeviceSetting struct {
|
|||
mtu int
|
||||
}
|
||||
|
||||
// serialize the config into an IPC request and DeviceSetting
|
||||
func createIPCRequest(conf *DeviceConfig) (*DeviceSetting, error) {
|
||||
// CreateIPCRequest serialize the config into an IPC request and DeviceSetting
|
||||
func CreateIPCRequest(conf *DeviceConfig) (*DeviceSetting, error) {
|
||||
var request bytes.Buffer
|
||||
|
||||
request.WriteString(fmt.Sprintf("private_key=%s\n", conf.SecretKey))
|
||||
|
@ -60,7 +60,7 @@ func createIPCRequest(conf *DeviceConfig) (*DeviceSetting, error) {
|
|||
|
||||
// StartWireguard creates a tun interface on netstack given a configuration
|
||||
func StartWireguard(conf *DeviceConfig, logLevel int) (*VirtualTun, error) {
|
||||
setting, err := createIPCRequest(conf)
|
||||
setting, err := CreateIPCRequest(conf)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue