# Class: TermServer

## vertx-shell-js/term_server~ TermServer

#### new TermServer()

A server for terminal based applications.

Source:
  - vertx-shell-js/term_server.js, line 36

### Methods

#### actualPort() → {number}

The actual port the server is listening on. This is useful if you bound the server specifying 0 as port number signifying an ephemeral port

Source:
  - vertx-shell-js/term_server.js, line 108

##### Returns:

the actual port the server is listening on.

Type
  number

#### authProvider(provider) → {TermServer}

Set an auth provider to use, any provider configured in options will override this provider. This should be used when a custom auth provider should be used.

##### Parameters:

Name | Type | Description
--- | --- | ---
`provider` | AuthProvider | the auth to use

Source:
  - vertx-shell-js/term_server.js, line 68

##### Returns:

this object

Type
  TermServer

#### close(completionHandler)

Like TermServer#close but supplying a handler that will be notified when close is complete.

##### Parameters:

Name | Type | Description
--- | --- | ---
`completionHandler` | function | the handler to be notified when the term server is closed

Source:
  - vertx-shell-js/term_server.js, line 121

#### listen(listenHandler) → {TermServer}

Bind the term server, the TermServer#termHandler must be set before.

##### Parameters:

Name | Type | Description
--- | --- | ---
`listenHandler` | function | the listen handler

Source:
  - vertx-shell-js/term_server.js, line 83

##### Returns:

this object

Type
  TermServer

#### termHandler(handler) → {TermServer}

Set the term handler that will receive incoming client connections. When a remote terminal connects the `handler` will be called with the Term which can be used to interact with the remote terminal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`handler` | function | the term handler

Source:
  - vertx-shell-js/term_server.js, line 50

##### Returns:

this object

Type
  TermServer