feat(uri): ссылка на звонок и пейсинг обфускации в freeturn://
vk применяется, только если своих ссылок не задано; timing - только вместе с обфускацией.
This commit is contained in:
1 parent
e102acbc4b
commit
64f8b63548
4 files changed
+47
No files matched your search
@@ -20,6 +20,7 @@ type Config struct {
|
||||
Mode string
|
||||
ObfProfile string
|
||||
ObfKey string
|
||||
ObfTimingMs int
|
||||
N int
|
||||
StreamsPerCred int
|
||||
ClientID string
|
||||
@@ -29,6 +30,7 @@ type Config struct {
|
||||
ManualCaptcha bool
|
||||
KCP *KCP
|
||||
Comment string
|
||||
VKLink string
|
||||
WGConf string
|
||||
}
|
||||
|
||||
@@ -41,6 +43,7 @@ type wire struct {
|
||||
Mode string `json:"mode,omitempty"`
|
||||
Obf string `json:"obf,omitempty"`
|
||||
Key string `json:"key,omitempty"`
|
||||
TimingMs int `json:"timing,omitempty"`
|
||||
N int `json:"n,omitempty"`
|
||||
StreamsPerCred int `json:"spc,omitempty"`
|
||||
ClientID string `json:"cid,omitempty"`
|
||||
@@ -50,6 +53,7 @@ type wire struct {
|
||||
ManualCaptcha bool `json:"mcap,omitempty"`
|
||||
KCP *KCP `json:"kcp,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
VK string `json:"vk,omitempty"`
|
||||
WGConf string `json:"wg,omitempty"`
|
||||
}
|
||||
|
||||
@@ -90,6 +94,7 @@ func Parse(s string) (*Config, error) {
|
||||
Mode: w.Mode,
|
||||
ObfProfile: w.Obf,
|
||||
ObfKey: w.Key,
|
||||
ObfTimingMs: w.TimingMs,
|
||||
N: w.N,
|
||||
StreamsPerCred: w.StreamsPerCred,
|
||||
ClientID: w.ClientID,
|
||||
@@ -99,6 +104,7 @@ func Parse(s string) (*Config, error) {
|
||||
ManualCaptcha: w.ManualCaptcha,
|
||||
KCP: w.KCP,
|
||||
Comment: w.Name,
|
||||
VKLink: w.VK,
|
||||
WGConf: w.WGConf,
|
||||
}, nil
|
||||
}
|
||||
@@ -120,11 +126,13 @@ func (c *Config) String() string {
|
||||
ManualCaptcha: c.ManualCaptcha,
|
||||
KCP: c.KCP,
|
||||
Name: c.Comment,
|
||||
VK: c.VKLink,
|
||||
WGConf: c.WGConf,
|
||||
}
|
||||
if c.ObfProfile != "" && c.ObfProfile != "none" {
|
||||
w.Obf = c.ObfProfile
|
||||
w.Key = c.ObfKey
|
||||
w.TimingMs = c.ObfTimingMs
|
||||
}
|
||||
|
||||
raw, err := json.Marshal(w)
|
||||
|
||||
@@ -21,6 +21,7 @@ func TestRoundTrip(t *testing.T) {
|
||||
Mode: "tcp",
|
||||
ObfProfile: "rtpopus",
|
||||
ObfKey: "d823fa",
|
||||
ObfTimingMs: 20,
|
||||
N: 16,
|
||||
StreamsPerCred: 8,
|
||||
ClientID: "abc123",
|
||||
@@ -29,6 +30,7 @@ func TestRoundTrip(t *testing.T) {
|
||||
DNSServers: "1.1.1.1,8.8.8.8",
|
||||
ManualCaptcha: true,
|
||||
Comment: "MyServer",
|
||||
VKLink: "https://vk.ru/call/join/abc",
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user