[id='socket-bindings_{context}']
= Socket bindings

Socket bindings map endpoint connectors to network interfaces and ports.
By default, {brandname} Server includes a socket binding configuration that listens on the localhost interface, `127.0.0.1`, at port `11222` for the REST and Hot Rod endpoints.
If you enable the Memcached endpoint, the default socket bindings configure {brandname} Server to bind to port `11221`.

.Default socket bindings
[source,xml,options="nowrap",subs=attributes+]
----
include::xml/server_network_socket_bindings.xml[]
----

[%autowidth,cols="1,1",stripes=even]
|===
|Configuration element or attribute |Description

|`socket-bindings`
|Root element that contains all network interfaces and ports to which {brandname} Server endpoints can bind and listen for client connections.

|`default-interface`
|Declare the network interface that {brandname} Server listens on by default.

|`port-offset`
|Specifies the offset that {brandname} Server applies to port declarations for socket bindings.

|`socket-binding`
|Configures {brandname} Server to bind to a port on a network interface.
|===

[discrete]
== Custom socket binding declarations

The following example configuration adds an `interface` declaration named "private" and a `socket-binding` declaration that binds {brandname} Server to the private IP address:

.XML
[source,xml,options="nowrap",subs=attributes+,role="primary"]
----
include::xml/server_socket_binding_private.xml[]
----

.JSON
[source,json,options="nowrap",subs=attributes+,role="secondary"]
----
include::json/server_socket_binding_private.json[]
----

.YAML
[source,yaml,options="nowrap",subs=attributes+,role="secondary"]
----
include::yaml/server_socket_binding_private.yaml[]
----
