All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.github.tim06.xrayConfiguration.outbounds.settings.VmessOutboundConfigurationObject.kt Maven / Gradle / Ivy

package io.github.tim06.xrayConfiguration.outbounds.settings

import io.github.tim06.xrayConfiguration.inbounds.settings.Method
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable

@Serializable
data class VmessOutboundConfigurationObject(
    @SerialName("vnext")
    val vnext: List,
) : OutboundConfigurationObject {

    @Serializable
    data class Server(
        @SerialName("address")
        val address: String,
        @SerialName("port")
        val port: Int,
        @SerialName("users")
        val users: List,
    ) {

        @Serializable
        data class User(
            @SerialName("id")
            val id: String,
            @SerialName("security")
            val security: Security,
            @SerialName("level")
            val level: Int? = null,
        )

        @Serializable
        enum class Security {
            @SerialName("none")
            NONE,

            @SerialName("auto")
            AUTO,

            @SerialName("zero")
            ZERO,

            @SerialName("aes-128-gcm")
            `AES-128-GCM`,

            @SerialName("chacha20-poly1305")
            `CHACHA20-POLY1305`;

            companion object {
                fun find(name: String): Security? {
                    return Security.entries.find { it.name.equals(other = name, ignoreCase = true) }
                }
            }
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy