@@ -70,7 +70,7 @@ namespace Shadowsocks.Encryption | |||||
{ | { | ||||
if (method.IsNullOrEmpty()) | if (method.IsNullOrEmpty()) | ||||
{ | { | ||||
method = "aes-256-cfb"; | |||||
method = Model.Server.DefaultMethod; | |||||
} | } | ||||
method = method.ToLowerInvariant(); | method = method.ToLowerInvariant(); | ||||
@@ -11,6 +11,9 @@ namespace Shadowsocks.Model | |||||
[Serializable] | [Serializable] | ||||
public class Server | public class Server | ||||
{ | { | ||||
public const string DefaultMethod = "chacha20-ietf-poly1305"; | |||||
public const int DefaultPort = 8388; | |||||
#region ParseLegacyURL | #region ParseLegacyURL | ||||
public static readonly Regex | public static readonly Regex | ||||
UrlFinder = new Regex(@"ss://(?<base64>[A-Za-z0-9+-/=_]+)(?:#(?<tag>\S+))?", RegexOptions.IgnoreCase), | UrlFinder = new Regex(@"ss://(?<base64>[A-Za-z0-9+-/=_]+)(?:#(?<tag>\S+))?", RegexOptions.IgnoreCase), | ||||
@@ -69,8 +72,8 @@ namespace Shadowsocks.Model | |||||
public Server() | public Server() | ||||
{ | { | ||||
server = ""; | server = ""; | ||||
server_port = 8388; | |||||
method = "chacha20-ietf-poly1305"; | |||||
server_port = DefaultPort; | |||||
method = DefaultMethod; | |||||
plugin = ""; | plugin = ""; | ||||
plugin_opts = ""; | plugin_opts = ""; | ||||
plugin_args = ""; | plugin_args = ""; | ||||
@@ -316,7 +316,7 @@ namespace Shadowsocks.View | |||||
IPTextBox.Text = server.server; | IPTextBox.Text = server.server; | ||||
ServerPortTextBox.Text = server.server_port.ToString(); | ServerPortTextBox.Text = server.server_port.ToString(); | ||||
PasswordTextBox.Text = server.password; | PasswordTextBox.Text = server.password; | ||||
EncryptionSelect.Text = server.method ?? "aes-256-cfb"; | |||||
EncryptionSelect.Text = server.method ?? Server.DefaultMethod; | |||||
PluginTextBox.Text = server.plugin; | PluginTextBox.Text = server.plugin; | ||||
PluginOptionsTextBox.Text = server.plugin_opts; | PluginOptionsTextBox.Text = server.plugin_opts; | ||||
PluginArgumentsTextBox.Text = server.plugin_args; | PluginArgumentsTextBox.Text = server.plugin_args; | ||||