HttpServer

open class HttpServer : NanoHTTPD(source)

Class for NanoHTTPD server.

The app starts and stops the server and the extension may not all the .start() and .stop(). The server will be started if the videoUrl or any of the Track urls matches PLACEHOLDER_URL. The url getter will return the scheme, domain, and port for the local server.

Since multiple servers may be running at the same time, even for the same source, it is recommended for the server not to share any state with the main extension class, nor is it recommended to use it for any functionality in the source other than fetching the video.

Since

extensions-lib 17

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
protected var asyncRunner: NanoHTTPD.AsyncRunner?
Link copied to clipboard
open val hostname: String?
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open var serverSocketFactory: NanoHTTPD.ServerSocketFactory?
Link copied to clipboard
open var tempFileManagerFactory: NanoHTTPD.TempFileManagerFactory?
Link copied to clipboard
val url: String

Functions

Link copied to clipboard
Link copied to clipboard
protected open fun createClientHandler(finalAccept: Socket?, inputStream: InputStream?): NanoHTTPD.ClientHandler?
Link copied to clipboard
protected open fun createServerRunnable(timeout: Int): NanoHTTPD.ServerRunnable?
Link copied to clipboard
open fun makeSecure(sslServerSocketFactory: SSLServerSocketFactory?, sslProtocols: Array<out String?>?)
Link copied to clipboard
open fun serve(session: NanoHTTPD.IHTTPSession?): NanoHTTPD.Response?
open fun serve(uri: String?, method: NanoHTTPD.Method?, headers: Map<String?, String?>?, parms: Map<String?, String?>?, files: Map<String?, String?>?): NanoHTTPD.Response?
Link copied to clipboard
open fun setAsyncRunner(asyncRunner: NanoHTTPD.AsyncRunner?)
Link copied to clipboard
open fun start()
open fun start(timeout: Int)
open fun start(timeout: Int, daemon: Boolean)
Link copied to clipboard
open fun stop()
Link copied to clipboard
protected open fun useGzipWhenAccepted(r: NanoHTTPD.Response?): Boolean
Link copied to clipboard