URLProtocol

data class URLProtocol

Represents URL protocol

Constructors

<init>

URLProtocol(name: String, defaultPort: Int)

Represents URL protocol

Properties

defaultPort

val defaultPort: Int

default port for protocol or -1 if not known

name

val name: String

of protocol (schema)

Companion Object Properties

HTTP

val HTTP: URLProtocol

HTTP with port 80

HTTPS

val HTTPS: URLProtocol

secure HTTPS with port 443

WS

val WS: URLProtocol

Web socket over HTTP on port 80

WSS

val WSS: URLProtocol

Web socket over secure HTTPS on port 443

byName

val byName: Map<String, URLProtocol>

Protocols by names map

Companion Object Functions

createOrDefault

fun createOrDefault(name: String): URLProtocol

Create an instance by name or use already existing instance

Extension Functions

isSecure

fun URLProtocol.isSecure(): Boolean

Check if the protocol is secure

isWebsocket

fun URLProtocol.isWebsocket(): Boolean

Check if the protocol is websocket