1
0
mirror of https://github.com/proxysu/ProxySU.git synced 2024-11-23 21:56:08 +03:00
ProxySU/ProxySuper.Core/Models/Projects/NaiveProxySettings.cs

54 lines
1.2 KiB
C#
Raw Normal View History

2021-06-17 13:54:07 +03:00
using Newtonsoft.Json;
2021-05-20 13:32:17 +03:00
using System.Collections.Generic;
2021-07-12 12:58:51 +03:00
using System.Linq;
2021-05-20 13:32:17 +03:00
namespace ProxySuper.Core.Models.Projects
{
public class NaiveProxySettings : IProjectSettings
{
2021-05-24 13:57:17 +03:00
public NaiveProxySettings()
{
Port = 443;
}
2021-07-12 12:58:51 +03:00
public List<int> FreePorts
{
get
{
return new List<int> { 80, 443, Port }.Distinct().ToList();
}
}
2021-05-24 13:57:17 +03:00
public ProjectType Type { get; set; } = ProjectType.NaiveProxy;
2021-05-20 13:32:17 +03:00
public int Port { get; set; }
public string Domain { get; set; }
2021-05-24 13:57:17 +03:00
public string UserName { get; set; }
2021-05-20 13:32:17 +03:00
2021-05-24 13:57:17 +03:00
public string Password { get; set; }
2021-05-25 13:28:37 +03:00
public string MaskDomain { get; set; }
2021-06-17 13:54:07 +03:00
[JsonIgnore]
public string Email
{
get
{
if (!string.IsNullOrEmpty(Domain))
{
var arr = Domain.Split('.');
if (arr.Length == 3)
{
return $"{arr[0]}@{arr[1]}.{arr[2]}";
}
}
return $"{UserName + Port.ToString()}@gmail.com";
}
}
2021-05-20 13:32:17 +03:00
}
}