---
title: "Data Encoding for Proxies"
url: https://docs.zeroc.com/ice/3.8/encoding/data-encoding-for-proxies
docs_index: https://docs.zeroc.com/llms.txt
---

> For an index of every page, see [llms.txt](https://docs.zeroc.com/llms.txt).

# Data Encoding for Proxies

## Encoding for Proxy Fields

The encoding format of proxies changed in version 1.1.

### Proxy Encoding Version 1.0

The first component of a marshaled proxy is a value of type `Ice::Identity`. If the proxy is a null value, the `category` and `name` fields are empty strings, and no additional data is marshaled. The encoding for a non-null proxy consists of proxy fields followed by endpoints.

The proxy fields are encoded as if they were fields of the following structure:

```slice
struct ProxyData
{
    Ice::Identity id;
    Ice::StringSeq facet;
    byte mode;
    bool secure;
}
```

The proxy fields are described in the table below:

| **Field** | **Description** |
| --- | --- |
| `id` | The [object identity](https://docs.zeroc.com/ice/3.8/runtime/object-identity.md) |
| `facet` | The [facet](https://docs.zeroc.com/ice/3.8/runtime/facets.md) name (zero- or one-element sequence) |
| `mode` | The proxy mode (`0`=twoway, `1`=oneway, `2`=batch oneway, `3`=datagram, `4`=batch datagram) |
| `secure` | Ignored. Kept for backwards compatibility. |

The `facet` field has either zero elements or one element. An empty sequence denotes the default facet, and a one-element sequence provides the facet name.

### Proxy Encoding Version 1.1

Version 1.1 of the encoding adds two fields to the existing proxy fields in version 1.0: protocol and encoding versions. The proxy fields are encoded as if they were fields of the following structure:

```slice
struct ProtocolVersion
{
    byte major;
    byte minor;
}

struct EncodingVersion
{
    byte major;
    byte minor;
}
struct ProxyData
{
    Ice::Identity id;
    Ice::StringSeq facet;
    byte mode;
    bool secure;
    ProtocolVersion protocol;
    EncodingVersion encoding;
}
```

The additional fields are described in the table below:

| **Field** | **Description** |
| --- | --- |
| `protocol` | The protocol version of the proxy: 1.0 for the Ice protocol. |
| `encoding` | The encoding version used to marshal the parameters of requests sent using this proxy. |

The encoding for [UDP endpoints](#encoding-for-udp-endpoints) also changed in version 1.1.

## Encoding for Endpoints

The proxy fields are followed by a [size](https://docs.zeroc.com/ice/3.8/encoding/basic-data-encoding.md), the number of endpoints, and then by the endpoints or, when this size is `0`, by the adapter ID encoded as a string. The adapter ID is the empty string for a [well-known proxy](https://docs.zeroc.com/ice/3.8/runtime/invocation/proxy-endpoints.md#well-known-proxy).

Each endpoint is encoded as a `short`, the [endpoint type](https://code.zeroc.com/ice/3.8/api/slice/namespaceIce.html#var-members), followed by an [encapsulation](https://docs.zeroc.com/ice/3.8/encoding/basic-data-encoding.md) of the type-specific fields described in the sections that follow.

## Encoding for TCP Endpoints

A TCP endpoint is encoded as an encapsulation containing the following structure:

```slice
struct TCPEndpointData
{
    string host;
    int port;
    int timeout;
    bool compress;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `host` | The server host (a host name or IP address) |
| `port` | The server port (`1`-`65535`) |
| `timeout` | The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility. |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |

## Encoding for UDP Endpoints

The encoding format of UDP endpoints changed in version 1.1.

### UDP Endpoint Encoding Version 1.0

A UDP endpoint is encoded as an encapsulation containing the following structure:

```slice
struct UDPEndpointData
{
    string host;
    int port;
    byte protocolMajor;
    byte protocolMinor;
    byte encodingMajor;
    byte encodingMinor;
    bool compress;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `host` | The server host (a host name or IP address) |
| `port` | The server port (`1`-`65535`) |
| `protocolMajor` | Always `1` |
| `protocolMinor` | Always `0` |
| `encodingMajor` | Always `1` |
| `encodingMinor` | Always `0` |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |

The four version fields are ignored when the endpoint is unmarshaled. They are kept for backwards compatibility.

### UDP Endpoint Encoding Version 1.1

Version 1.1 of the encoding omits the protocol and encoding versions because these fields are handled as proxy fields instead:

```slice
struct UDPEndpointData
{
    string host;
    int port;
    bool compress;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `host` | The server host (a host name or IP address) |
| `port` | The server port (`1`-`65535`) |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |

## Encoding for SSL Endpoints

An SSL endpoint is encoded as an encapsulation containing the following structure:

```slice
struct SSLEndpointData
{
    string host;
    int port;
    int timeout;
    bool compress;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `host` | The server host (a host name or IP address) |
| `port` | The server port (`1`-`65535`) |
| `timeout` | The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility. |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |

## Encoding for WS Endpoints

A WebSocket endpoint is encoded as an encapsulation containing the following structure:

```slice
struct WSEndpointData
{
    string host;
    int port;
    int timeout;
    bool compress;
    string resource;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `host` | The server host (a host name or IP address) |
| `port` | The server port (`1`-`65535`) |
| `timeout` | The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility. |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |
| `resource` | A URI representing the web server resource associated with this endpoint |

## Encoding for WSS Endpoints

A secure WebSocket endpoint is encoded as an encapsulation containing the following structure:

```slice
struct WSSEndpointData
{
    string host;
    int port;
    int timeout;
    bool compress;
    string resource;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `host` | The server host (a host name or IP address) |
| `port` | The server port (`1`-`65535`) |
| `timeout` | The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility. |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |
| `resource` | A URI representing the web server resource associated with this endpoint |

## Encoding for BT Endpoints

A Bluetooth endpoint is encoded as an encapsulation containing the following structure:

```slice
struct BTEndpointData
{
    string addr;
    string uuid;
    int timeout;
    bool compress;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `addr` | The Bluetooth address of the server |
| `uuid` | The UUID of the target service |
| `timeout` | The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility. |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |

## Encoding for BTS Endpoints

A secure Bluetooth endpoint is encoded as an encapsulation containing the following structure:

```slice
struct BTSEndpointData
{
    string addr;
    string uuid;
    int timeout;
    bool compress;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `addr` | The Bluetooth address of the server |
| `uuid` | The UUID of the target service |
| `timeout` | The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility. |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |

## Encoding for iAP Endpoints

An iAP endpoint is encoded as an encapsulation containing the following structure:

```slice
struct IAPEndpointData
{
    string manufacturer;
    string modelNumber;
    string name;
    string protocol;
    int timeout;
    bool compress;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `manufacturer` | The accessory manufacturer |
| `modelNumber` | The accessory model number |
| `name` | The accessory name |
| `protocol` | The protocol implemented by the accessory |
| `timeout` | The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility. |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |

## Encoding for iAPS Endpoints

A secure iAP endpoint is encoded as an encapsulation containing the following structure:

```slice
struct IAPSEndpointData
{
    string manufacturer;
    string modelNumber;
    string name;
    string protocol;
    int timeout;
    bool compress;
}
```

The endpoint fields are described in the following table.

| **Field** | **Description** |
| --- | --- |
| `manufacturer` | The accessory manufacturer |
| `modelNumber` | The accessory model number |
| `name` | The accessory name |
| `protocol` | The protocol implemented by the accessory |
| `timeout` | The timeout in milliseconds for socket operations. This field is no longer used but is kept for backwards compatibility. |
| `compress` | `true` if [compression](https://docs.zeroc.com/ice/3.8/protocol/protocol-compression.md) should be used (if possible), otherwise `false` |
