mirror of
https://github.com/XTLS/Xray-core.git
synced 2026-07-02 17:58:46 +00:00
862631172d
And https://github.com/XTLS/Xray-core/pull/6303#issuecomment-4669158076 Fixes https://github.com/XTLS/Xray-core/issues/6257
19 lines
389 B
Go
19 lines
389 B
Go
package wireguard
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/xtls/xray-core/common"
|
|
)
|
|
|
|
func init() {
|
|
common.Must(common.RegisterConfig((*DeviceConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
|
deviceConfig := config.(*DeviceConfig)
|
|
if deviceConfig.IsClient {
|
|
return NewClient(ctx, deviceConfig)
|
|
} else {
|
|
return NewServer(ctx, deviceConfig)
|
|
}
|
|
}))
|
|
}
|