Packages

class Server extends Object with StObject

Annotations
@JSType() @JSImport("http", "Server") @native()
Since

v0.1.17

Linear Supertypes
StObject, Object, Any, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Server
  2. StObject
  3. Object
  4. Any
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new Server(options: ServerOptions, requestListener: RequestListener)
  2. new Server(requestListener: RequestListener)
  3. new Server(options: ServerOptions)
  4. new Server()

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addListener(event: String, listener: Function1[Any, Unit]): Server.this.type
  5. def addListener_checkContinue(event: checkContinue, listener: RequestListener): Server.this.type
    Annotations
    @JSName("addListener")
  6. def addListener_checkExpectation(event: checkExpectation, listener: RequestListener): Server.this.type
    Annotations
    @JSName("addListener")
  7. def addListener_clientError(event: clientError, listener: Function2[Error, Duplex, Unit]): Server.this.type
    Annotations
    @JSName("addListener")
  8. def addListener_close(event: close, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("addListener")
  9. def addListener_connect(event: connect, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("addListener")
  10. def addListener_connection(event: connection, listener: Function1[Socket, Unit]): Server.this.type
    Annotations
    @JSName("addListener")
  11. def addListener_error(event: error, listener: Function1[Error, Unit]): Server.this.type
    Annotations
    @JSName("addListener")
  12. def addListener_listening(event: listening, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("addListener")
  13. def addListener_request(event: request, listener: RequestListener): Server.this.type
    Annotations
    @JSName("addListener")
  14. def addListener_upgrade(event: upgrade, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("addListener")
  15. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  16. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
  17. def emit(event: String, args: Any*): Boolean
  18. def emit_checkContinue(event: checkContinue, req: IncomingMessage, res: ServerResponse): Boolean
    Annotations
    @JSName("emit")
  19. def emit_checkExpectation(event: checkExpectation, req: IncomingMessage, res: ServerResponse): Boolean
    Annotations
    @JSName("emit")
  20. def emit_clientError(event: clientError, err: Error, socket: Duplex): Boolean
    Annotations
    @JSName("emit")
  21. def emit_close(event: close): Boolean
    Annotations
    @JSName("emit")
  22. def emit_connect(event: connect, req: IncomingMessage, socket: Duplex, head: Buffer): Boolean
    Annotations
    @JSName("emit")
  23. def emit_connection(event: connection, socket: Socket): Boolean
    Annotations
    @JSName("emit")
  24. def emit_error(event: error, err: Error): Boolean
    Annotations
    @JSName("emit")
  25. def emit_listening(event: listening): Boolean
    Annotations
    @JSName("emit")
  26. def emit_request(event: request, req: IncomingMessage, res: ServerResponse): Boolean
    Annotations
    @JSName("emit")
  27. def emit_upgrade(event: upgrade, req: IncomingMessage, socket: Duplex, head: Buffer): Boolean
    Annotations
    @JSName("emit")
  28. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  29. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  30. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  31. def hasOwnProperty(v: String): Boolean
    Definition Classes
    Object
  32. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  33. var headersTimeout: Double

    Limit the amount of time the parser will wait to receive the complete HTTP headers.

    Limit the amount of time the parser will wait to receive the complete HTTP headers.

    In case of inactivity, the rules defined in server.timeout apply. However, that inactivity based timeout would still allow the connection to be kept open if the headers are being sent very slowly (by default, up to a byte per 2 minutes). In order to prevent this, whenever header data arrives an additional check is made that more than server.headersTimeout milliseconds has not passed since the connection was established. If the check fails, a 'timeout'event is emitted on the server object, and (by default) the socket is destroyed. See server.timeout for more information on how timeout behavior can be customized.

    Since

    v11.3.0, v10.14.0

  34. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  35. def isPrototypeOf(v: Object): Boolean
    Definition Classes
    Object
  36. var keepAliveTimeout: Double

    The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed.

    The number of milliseconds of inactivity a server needs to wait for additional incoming data, after it has finished writing the last response, before a socket will be destroyed. If the server receives new data before the keep-alive timeout has fired, it will reset the regular inactivity timeout, i.e.,server.timeout.

    A value of 0 will disable the keep-alive timeout behavior on incoming connections. A value of 0 makes the http server behave similarly to Node.js versions prior to 8.0.0, which did not have a keep-alive timeout.

    The socket timeout logic is set up on connection, so changing this value only affects new connections to the server, not any existing connections.

    Since

    v8.0.0

  37. var maxHeadersCount: |[Double, Null]

    Limits maximum incoming headers count.

    Limits maximum incoming headers count. If set to 0, no limit will be applied.

    Since

    v0.7.0

  38. var maxRequestsPerSocket: |[Double, Null]

    The maximum number of requests socket can handle before closing keep alive connection.

    The maximum number of requests socket can handle before closing keep alive connection.

    A value of 0 will disable the limit.

    When the limit is reached it will set the Connection header value to close, but will not actually close the connection, subsequent requests sent after the limit is reached will get 503 Service Unavailable as a response.

    Since

    v16.10.0

  39. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  40. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  41. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  42. def on(event: String, listener: Function1[Any, Unit]): Server.this.type
  43. def on_checkContinue(event: checkContinue, listener: RequestListener): Server.this.type
    Annotations
    @JSName("on")
  44. def on_checkExpectation(event: checkExpectation, listener: RequestListener): Server.this.type
    Annotations
    @JSName("on")
  45. def on_clientError(event: clientError, listener: Function2[Error, Duplex, Unit]): Server.this.type
    Annotations
    @JSName("on")
  46. def on_close(event: close, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("on")
  47. def on_connect(event: connect, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("on")
  48. def on_connection(event: connection, listener: Function1[Socket, Unit]): Server.this.type
    Annotations
    @JSName("on")
  49. def on_error(event: error, listener: Function1[Error, Unit]): Server.this.type
    Annotations
    @JSName("on")
  50. def on_listening(event: listening, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("on")
  51. def on_request(event: request, listener: RequestListener): Server.this.type
    Annotations
    @JSName("on")
  52. def on_upgrade(event: upgrade, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("on")
  53. def once(event: String, listener: Function1[Any, Unit]): Server.this.type
  54. def once_checkContinue(event: checkContinue, listener: RequestListener): Server.this.type
    Annotations
    @JSName("once")
  55. def once_checkExpectation(event: checkExpectation, listener: RequestListener): Server.this.type
    Annotations
    @JSName("once")
  56. def once_clientError(event: clientError, listener: Function2[Error, Duplex, Unit]): Server.this.type
    Annotations
    @JSName("once")
  57. def once_close(event: close, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("once")
  58. def once_connect(event: connect, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("once")
  59. def once_connection(event: connection, listener: Function1[Socket, Unit]): Server.this.type
    Annotations
    @JSName("once")
  60. def once_error(event: error, listener: Function1[Error, Unit]): Server.this.type
    Annotations
    @JSName("once")
  61. def once_listening(event: listening, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("once")
  62. def once_request(event: request, listener: RequestListener): Server.this.type
    Annotations
    @JSName("once")
  63. def once_upgrade(event: upgrade, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("once")
  64. def prependListener(event: String, listener: Function1[Any, Unit]): Server.this.type
  65. def prependListener_checkContinue(event: checkContinue, listener: RequestListener): Server.this.type
    Annotations
    @JSName("prependListener")
  66. def prependListener_checkExpectation(event: checkExpectation, listener: RequestListener): Server.this.type
    Annotations
    @JSName("prependListener")
  67. def prependListener_clientError(event: clientError, listener: Function2[Error, Duplex, Unit]): Server.this.type
    Annotations
    @JSName("prependListener")
  68. def prependListener_close(event: close, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("prependListener")
  69. def prependListener_connect(event: connect, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("prependListener")
  70. def prependListener_connection(event: connection, listener: Function1[Socket, Unit]): Server.this.type
    Annotations
    @JSName("prependListener")
  71. def prependListener_error(event: error, listener: Function1[Error, Unit]): Server.this.type
    Annotations
    @JSName("prependListener")
  72. def prependListener_listening(event: listening, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("prependListener")
  73. def prependListener_request(event: request, listener: RequestListener): Server.this.type
    Annotations
    @JSName("prependListener")
  74. def prependListener_upgrade(event: upgrade, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("prependListener")
  75. def prependOnceListener(event: String, listener: Function1[Any, Unit]): Server.this.type
  76. def prependOnceListener_checkContinue(event: checkContinue, listener: RequestListener): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  77. def prependOnceListener_checkExpectation(event: checkExpectation, listener: RequestListener): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  78. def prependOnceListener_clientError(event: clientError, listener: Function2[Error, Duplex, Unit]): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  79. def prependOnceListener_close(event: close, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  80. def prependOnceListener_connect(event: connect, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  81. def prependOnceListener_connection(event: connection, listener: Function1[Socket, Unit]): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  82. def prependOnceListener_error(event: error, listener: Function1[Error, Unit]): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  83. def prependOnceListener_listening(event: listening, listener: Function0[Unit]): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  84. def prependOnceListener_request(event: request, listener: RequestListener): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  85. def prependOnceListener_upgrade(event: upgrade, listener: Function3[IncomingMessage, Duplex, Buffer, Unit]): Server.this.type
    Annotations
    @JSName("prependOnceListener")
  86. def propertyIsEnumerable(v: String): Boolean
    Definition Classes
    Object
  87. var requestTimeout: Double

    Sets the timeout value in milliseconds for receiving the entire request from the client.

    Sets the timeout value in milliseconds for receiving the entire request from the client.

    If the timeout expires, the server responds with status 408 without forwarding the request to the request listener and then closes the connection.

    It must be set to a non-zero value (e.g. 120 seconds) to protect against potential Denial-of-Service attacks in case the server is deployed without a reverse proxy in front.

    Since

    v14.11.0

  88. def setTimeout(msecs: Unit, callback: Function0[Unit]): Server.this.type
  89. def setTimeout(msecs: Double, callback: Function0[Unit]): Server.this.type
  90. def setTimeout(msecs: Double): Server.this.type
  91. def setTimeout(callback: Function0[Unit]): Server.this.type
  92. def setTimeout(): Server.this.type

    Sets the timeout value for sockets, and emits a 'timeout' event on the Server object, passing the socket as an argument, if a timeout occurs.

    Sets the timeout value for sockets, and emits a 'timeout' event on the Server object, passing the socket as an argument, if a timeout occurs.

    If there is a 'timeout' event listener on the Server object, then it will be called with the timed-out socket as an argument.

    By default, the Server does not timeout sockets. However, if a callback is assigned to the Server's 'timeout' event, timeouts must be handled explicitly.

    Since

    v0.9.12

  93. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  94. var timeout: Double

    The number of milliseconds of inactivity before a socket is presumed to have timed out.

    The number of milliseconds of inactivity before a socket is presumed to have timed out.

    A value of 0 will disable the timeout behavior on incoming connections.

    The socket timeout logic is set up on connection, so changing this value only affects new connections to the server, not any existing connections.

    Since

    v0.9.12

  95. def toLocaleString(): String
    Definition Classes
    Object
  96. def toString(): String
    Definition Classes
    AnyRef → Any
  97. def valueOf(): Any
    Definition Classes
    Object
  98. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  99. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  100. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable]) @Deprecated
    Deprecated

Inherited from StObject

Inherited from Object

Inherited from Any

Inherited from AnyRef

Inherited from Any

Ungrouped