53 lines
1.9 KiB
Vala
53 lines
1.9 KiB
Vala
/* vless.vala
|
|
*
|
|
* Copyright 2025 Vasiliy Doylov (NekoCWD) <nekocwd@mainlining.org>
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
/*
|
|
* Vless outbound.
|
|
* DASH and TYPE FIX REQUIRED
|
|
*/
|
|
class Singularity.Outbound.Vless : Dial, Json.Serializable {
|
|
public string server { get; set; default = null; }
|
|
public int64 server_port { get; set; default = 1080; }
|
|
public string uuid { get; set; default = null; }
|
|
public string flow { get; set; default = null; }
|
|
public string network { get; set; default = null; }
|
|
public TLS tls { get; set; default = null; }
|
|
public string packet_encoding { get; set; default = null; }
|
|
public Transport.Transport transport { get; set; default = null; }
|
|
/*
|
|
* public Multiplex multiplex { get; set; default = null; }
|
|
* TODO: Implement Multiplex
|
|
*/
|
|
|
|
construct {
|
|
type_name = "vless";
|
|
}
|
|
|
|
public override Json.Node serialize_property (string property_name, GLib.Value value, GLib.ParamSpec pspec) {
|
|
var node = default_serialize_property (property_name, value, pspec);
|
|
if (property_name == "transport" && transport != null) {
|
|
return Utils.fix_dash (Utils.fix_type (node));
|
|
}
|
|
if (property_name == "tls" && tls != null) {
|
|
return Utils.fix_dash (node);
|
|
}
|
|
return node;
|
|
}
|
|
}
|