org.vertx.scala.core.http

HttpServer

final class HttpServer extends Self with ServerTCPSupport with ServerSSLSupport with Closeable

An HTTP and WebSockets server

If an instance is instantiated from an event loop then the handlers of the instance will always be called on that same event loop. If an instance is instantiated from some other arbitrary Java thread then an event loop will be assigned to the instance and used when any of its handlers are called.

Instances of HttpServer are thread-safe.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. HttpServer
  2. Closeable
  3. ServerSSLSupport
  4. SSLSupport
  5. ServerTCPSupport
  6. TCPSupport
  7. NetworkSupport
  8. AsJava
  9. Self
  10. AnyRef
  11. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Type Members

  1. type CloseType = AnyRef { ... /* 2 definitions in type refinement */ }

    Definition Classes
    Closeable
  2. type J = java.core.http.HttpServer

    The internal type of the Java wrapped class.

    The internal type of the Java wrapped class.

    Definition Classes
    HttpServerCloseableServerSSLSupportSSLSupportServerTCPSupportTCPSupportNetworkSupport → AsJava

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  7. val asJava: java.core.http.HttpServer

    The internal instance of the Java wrapped class.

    The internal instance of the Java wrapped class.

    Definition Classes
    HttpServer → AsJava
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def close(handler: (AsyncResult[Void]) ⇒ Unit): Unit

    Close this org.vertx.scala.core.Closeable instance asynchronously and notifies the handler once done.

    Close this org.vertx.scala.core.Closeable instance asynchronously and notifies the handler once done.

    Definition Classes
    Closeable
  10. def close(): Unit

    Close this org.vertx.scala.core.Closeable instance asynchronously.

    Close this org.vertx.scala.core.Closeable instance asynchronously.

    Definition Classes
    Closeable
  11. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. def getAcceptBacklog: Int

    returns

    The accept backlog

    Definition Classes
    ServerTCPSupport
  15. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  16. def getKeyStorePassword: String

    returns

    Get the key store password

    Definition Classes
    SSLSupport
  17. def getKeyStorePath: String

    returns

    Get the key store path

    Definition Classes
    SSLSupport
  18. def getMaxWebSocketFrameSize: Int

    Get the maximum websocket frame size in bytes.

  19. def getReceiveBufferSize: Int

    returns

    The receive buffer size

    Definition Classes
    NetworkSupport
  20. def getSendBufferSize: Int

    returns

    The send buffer size

    Definition Classes
    NetworkSupport
  21. def getSoLinger: Int

    returns

    the value of TCP so linger

    Definition Classes
    TCPSupport
  22. def getTrafficClass: Int

    returns

    the value of traffic class

    Definition Classes
    NetworkSupport
  23. def getTrustStorePassword: String

    returns

    Get trust store password

    Definition Classes
    SSLSupport
  24. def getTrustStorePath: String

    returns

    Get the trust store path

    Definition Classes
    SSLSupport
  25. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  26. def isClientAuthRequired: Boolean

    Is client auth required?

    Is client auth required?

    Definition Classes
    ServerSSLSupport
  27. def isCompressionSupported: Boolean

    Returns true if the org.vertx.scala.core.http.HttpServer should compress the http response if the connected client supports it.

  28. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  29. def isReuseAddress: Boolean

    returns

    The value of reuse address

    Definition Classes
    NetworkSupport
  30. def isSSL: Boolean

    returns

    Is SSL enabled?

    Definition Classes
    SSLSupport
  31. def isTCPKeepAlive: Boolean

    returns

    true if TCP keep alive is enabled

    Definition Classes
    TCPSupport
  32. def isTCPNoDelay: Boolean

    returns

    true if Nagle's algorithm is disabled.

    Definition Classes
    TCPSupport
  33. def isUsePooledBuffers: Boolean

    returns

    true if pooled buffers are used

    Definition Classes
    TCPSupport
  34. def listen(port: Int): HttpServer

    Tell the server to start listening on all available interfaces and port port.

    Tell the server to start listening on all available interfaces and port port. Be aware this is an async operation and the server may not bound on return of the method.

    port

    The port to listen on.

  35. def listen(port: Int, listenHandler: (AsyncResult[HttpServer]) ⇒ Unit): HttpServer

    Tell the server to start listening on all available interfaces and port port.

    Tell the server to start listening on all available interfaces and port port.

    port

    The port to listen on.

    listenHandler

    Callback when bind is done.

  36. def listen(port: Int, host: String): HttpServer

    Tell the server to start listening on port port and hostname or ip address given by host.

    Tell the server to start listening on port port and hostname or ip address given by host. Be aware this is an

    async operation and the server may not bound on return of the method.

    port

    The port to listen on.

    host

    The hostname or ip address.

  37. def listen(port: Int, host: String, listenHandler: (AsyncResult[HttpServer]) ⇒ Unit): HttpServer

    Tell the server to start listening on port port} and hostname or ip address given by host}.

    Tell the server to start listening on port port} and hostname or ip address given by host}.

    port

    The port to listen on.

    host

    The hostname or ip address.

    listenHandler

    Callback when bind is done.

  38. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  39. final def notify(): Unit

    Definition Classes
    AnyRef
  40. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  41. def requestHandler(requestHandler: (HttpServerRequest) ⇒ Unit): HttpServer

    Set the request handler for the server to requestHandler.

    Set the request handler for the server to requestHandler. As HTTP requests are received by the server, instances of org.vertx.scala.core.http.HttpServerRequest will be created and passed to this handler.

    returns

    a reference to this, so methods can be chained.

  42. def requestHandler(): (HttpServerRequest) ⇒ Unit

    Get the request handler.

    Get the request handler.

    returns

    The request handler.

  43. def setAcceptBacklog(backlog: Int): HttpServer.this.type

    Set the accept backlog

    Set the accept backlog

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    ServerTCPSupport
  44. def setClientAuthRequired(required: Boolean): HttpServer.this.type

    Set required to true if you want the server to request client authentication from any connecting clients.

    Set required to true if you want the server to request client authentication from any connecting clients. This is an extra level of security in SSL, and requires clients to provide client certificates. Those certificates must be added to the server trust store.

    returns

    A reference to this, so multiple invocations can be chained together.

    Definition Classes
    ServerSSLSupport
  45. def setCompressionSupported(compressionSupported: Boolean): HttpServer

    Set if the org.vertx.scala.core.http.HttpServer should compress the http response if the connected client supports it.

  46. def setKeyStorePassword(pwd: String): HttpServer.this.type

    Set the password for the SSL key store.

    Set the password for the SSL key store. This method should only be used in SSL mode, i.e. after org.vertx.scala.core.SSLSupport.setSSL(boolean) has been set to true.

    returns

    A reference to this, so multiple invocations can be chained together.

    Definition Classes
    SSLSupport
  47. def setKeyStorePath(path: String): HttpServer.this.type

    Set the path to the SSL key store.

    Set the path to the SSL key store. This method should only be used in SSL mode, i.e. after org.vertx.scala.core.SSLSupport.setSSL(boolean) has been set to true.

    The SSL key store is a standard Java Key Store, and will contain the client certificate. Client certificates are only required if the server requests client authentication.

    returns

    A reference to this, so multiple invocations can be chained together.

    Definition Classes
    SSLSupport
  48. def setMaxWebSocketFrameSize(maxSize: Int): HttpServer

    Sets the maximum websocket frame size in bytes.

    Sets the maximum websocket frame size in bytes. Default is 65536 bytes.

    maxSize

    The size in bytes

  49. def setReceiveBufferSize(size: Int): HttpServer.this.type

    Set the receive buffer size for connections created by this instance to size in bytes.

    Set the receive buffer size for connections created by this instance to size in bytes.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    NetworkSupport
  50. def setReuseAddress(reuse: Boolean): HttpServer.this.type

    Set the reuseAddress setting for connections created by this instance to reuse.

    Set the reuseAddress setting for connections created by this instance to reuse.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    NetworkSupport
  51. def setSSL(ssl: Boolean): HttpServer.this.type

    If ssl is true, this signifies that any connections will be SSL connections.

    If ssl is true, this signifies that any connections will be SSL connections.

    returns

    A reference to this, so multiple invocations can be chained together.

    Definition Classes
    SSLSupport
  52. def setSendBufferSize(size: Int): HttpServer.this.type

    Set the send buffer size for connections created by this instance to size in bytes.

    Set the send buffer size for connections created by this instance to size in bytes.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    NetworkSupport
  53. def setSoLinger(linger: Int): HttpServer.this.type

    Set the TCP soLinger setting for connections created by this instance to linger.

    Set the TCP soLinger setting for connections created by this instance to linger. Using a negative value will disable soLinger.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    TCPSupport
  54. def setTCPKeepAlive(keepAlive: Boolean): HttpServer.this.type

    Set the TCP keepAlive setting for connections created by this instance to keepAlive.

    Set the TCP keepAlive setting for connections created by this instance to keepAlive.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    TCPSupport
  55. def setTCPNoDelay(tcpNoDelay: Boolean): HttpServer.this.type

    If tcpNoDelay is set to true then Nagle's algorithm will turned off for the TCP connections created by this instance.

    If tcpNoDelay is set to true then Nagle's algorithm will turned off for the TCP connections created by this instance.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    TCPSupport
  56. def setTrafficClass(trafficClass: Int): HttpServer.this.type

    Set the trafficClass setting for connections created by this instance to trafficClass.

    Set the trafficClass setting for connections created by this instance to trafficClass.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    NetworkSupport
  57. def setTrustStorePassword(pwd: String): HttpServer.this.type

    Set the password for the SSL trust store.

    Set the password for the SSL trust store. This method should only be used in SSL mode, i.e. after org.vertx.scala.core.SSLSupport.setSSL(boolean) has been set to true.

    returns

    A reference to this, so multiple invocations can be chained together.

    Definition Classes
    SSLSupport
  58. def setTrustStorePath(path: String): HttpServer.this.type

    Set the path to the SSL trust store.

    Set the path to the SSL trust store. This method should only be used in SSL mode, i.e. after org.vertx.scala.core.SSLSupport.setSSL(boolean) has been set to true.

    The trust store is a standard Java Key Store, and should contain the certificates of any servers that the client trusts.

    returns

    A reference to this, so multiple invocations can be chained together.

    Definition Classes
    SSLSupport
  59. def setUsePooledBuffers(pooledBuffers: Boolean): HttpServer.this.type

    Set if vertx should use pooled buffers for performance reasons.

    Set if vertx should use pooled buffers for performance reasons. Doing so will give the best throughput but may need a bit higher memory footprint.

    returns

    a reference to this so multiple method calls can be chained together

    Definition Classes
    TCPSupport
  60. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  61. def toString(): String

    Definition Classes
    AnyRef → Any
  62. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  63. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  64. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  65. def websocketHandler(wsHandler: (ServerWebSocket) ⇒ Unit): HttpServer

    Set the websocket handler for the server to wsHandler.

    Set the websocket handler for the server to wsHandler. If a websocket connect handshake is successful a new org.vertx.scala.core.http.ServerWebSocket instance will be created and passed to the handler.

    returns

    a reference to this, so methods can be chained.

  66. def websocketHandler(): (ServerWebSocket) ⇒ Unit

    Get the websocket handler

    Get the websocket handler

    returns

    The websocket handler

  67. def wrap[X](doStuff: ⇒ X): HttpServer.this.type

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Helper method wrapping invocations and returning the Scala type, once again to help provide fluent return types

    Attributes
    protected[this]
    Definition Classes
    Self

Inherited from Closeable

Inherited from ServerSSLSupport

Inherited from SSLSupport

Inherited from ServerTCPSupport

Inherited from TCPSupport

Inherited from NetworkSupport

Inherited from AsJava

Inherited from Self

Inherited from AnyRef

Inherited from Any

Ungrouped