Class

io.scalajs.nodejs.http.Server

ServerEvents

Related Doc: package Server

Permalink

implicit final class ServerEvents extends AnyVal

Server Events

Linear Supertypes
AnyVal, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ServerEvents
  2. AnyVal
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ServerEvents(server: Server)

    Permalink

    server

    the given Server

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def getClass(): Class[_ <: AnyVal]

    Permalink
    Definition Classes
    AnyVal → Any
  6. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  7. def onCheckContinue(callback: (IncomingMessage, ServerResponse) ⇒ Any): server.type

    Permalink

    Emitted each time a request with an HTTP Expect: 100-continue is received.

    Emitted each time a request with an HTTP Expect: 100-continue is received. If this event is not listened for, the server will automatically respond with a 100 Continue as appropriate.

    Handling this event involves calling response.writeContinue() if the client should continue to send the request body, or generating an appropriate HTTP response (e.g. 400 Bad Request) if the client should not continue to send the request body. - request <http.IncomingMessage> - response <http.ServerResponse>

  8. def onCheckExpectation(callback: (ClientRequest, ServerResponse) ⇒ Any): server.type

    Permalink

    Emitted each time a request with an http Expect header is received, where the value is not 100-continue.

    Emitted each time a request with an http Expect header is received, where the value is not 100-continue. If this event isn't listened for, the server will automatically respond with a 417 Expectation Failed as appropriate. Note that when this event is emitted and handled, the request event will not be emitted. - request <http.ClientRequest> - response <http.ServerResponse>

    Annotations
    @inline()
  9. def onClientError(callback: (Error, Socket) ⇒ Any): server.type

    Permalink

    If a client connection emits an 'error' event, it will be forwarded here.

    If a client connection emits an 'error' event, it will be forwarded here. Listener of this event is responsible for closing/destroying the underlying socket. For example, one may wish to more gracefully close the socket with an HTTP '400 Bad Request' response instead of abruptly severing the connection.

    Default behavior is to destroy the socket immediately on malformed request. - exception <Error> - socket <net.Socket>

    Annotations
    @inline()
  10. def onClose(handler: () ⇒ Any): server.type

    Permalink

    Emitted when the server closes.

    Emitted when the server closes.

    Annotations
    @inline()
  11. def onConnect(handler: (IncomingMessage, Socket, Buffer) ⇒ Any): server.type

    Permalink

    Emitted each time a client requests an HTTP CONNECT method.

    Emitted each time a client requests an HTTP CONNECT method. If this event is not listened for, then clients requesting a CONNECT method will have their connections closed.

    After this event is emitted, the request's socket will not have a 'data' event listener, meaning you will need to bind to it in order to handle data sent to the server on that socket. - request <http.IncomingMessage> Arguments for the HTTP request, as it is in the 'request' event - socket <net.Socket> Network socket between the server and client - head <Buffer> The first packet of the tunneling stream (may be empty)

    Annotations
    @inline()
  12. def onConnection(handler: (Socket) ⇒ Any): server.type

    Permalink

    When a new TCP stream is established.

    When a new TCP stream is established. socket is an object of type net.Socket. Usually users will not want to access this event. In particular, the socket will not emit 'readable' events because of how the protocol parser attaches to the socket. The socket can also be accessed at request.connection. - socket <net.Socket>

    Annotations
    @inline()
  13. def onRequest(handler: (IncomingMessage, ServerResponse) ⇒ Any): server.type

    Permalink

    Emitted each time there is a request.

    Emitted each time there is a request. Note that there may be multiple requests per connection (in the case of HTTP Keep-Alive connections). - request <http.IncomingMessage> - response <http.ServerResponse>

    Annotations
    @inline()
  14. def onUpgrade(handler: (IncomingMessage, Socket, Buffer) ⇒ Any): server.type

    Permalink

    Emitted each time a client requests an HTTP upgrade.

    Emitted each time a client requests an HTTP upgrade. If this event is not listened for, then clients requesting an upgrade will have their connections closed.

    After this event is emitted, the request's socket will not have a 'data' event listener, meaning you will need to bind to it in order to handle data sent to the server on that socket. - request <http.IncomingMessage> Arguments for the HTTP request, as it is in the 'request' event - socket <net.Socket> Network socket between the server and client - head <Buffer> The first packet of the upgraded stream (may be empty)

    Annotations
    @inline()
  15. val server: Server

    Permalink

    the given Server

  16. def toString(): String

    Permalink
    Definition Classes
    Any

Inherited from AnyVal

Inherited from Any

Ungrouped