# ServerOpt

`SeverOpt` is a type that represents a function that allow you to override the default settings of the `New()` method with your own settings.

{% tabs %}
{% tab title="Signature" %}

```go
type ServerOpt func(*Server)
```

{% endtab %}
{% endtabs %}

**pps** provides the following `ServerOpt` functions:

### WithAddr

`WithAddr()` allows you to set the listening address for the TCP server (Default: `0.0.0.0`)

{% tabs %}
{% tab title="Signature" %}

```go
func WithAddr(string) ServerOpt
```

{% endtab %}

{% tab title="Example" %}

```go
s := pps.New(WithAddr("127.0.0.1"))
```

{% endtab %}
{% endtabs %}

### WithPort

`WithPort()` allows you to set the listening port for the TCP server (Default: `10005`)

{% tabs %}
{% tab title="Signature" %}

```go
func WithPort(string) ServerOpt
```

{% endtab %}

{% tab title="Example" %}

```go
s := pps.New(WithPort("10006"))
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://pps-docs.pebcak.de/api/serveropt.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
