> For the complete documentation index, see [llms.txt](https://fish-networking.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fish-networking.gitbook.io/docs/guides/features/transports/multipass.md).

# Multipass

{% hint style="info" %}
You may want to access specific transports directly. You can do so by getting a reference to Multipass and calling multipassReference.GetTransport\<Type>().

The Transports collection is also publicly accessible within Multipass.
{% endhint %}

## Setup <a href="#guide-setup" id="guide-setup"></a>

Like other transports to use Multipass it must be added to a gameObject, generally your NetworkManager object. After adding Multipass you must assign it as the transport to use within [TransportManager](/docs/fishnet-building-blocks/components/managers/transportmanager.md). If TransportManager is not added to your NetworkManager automatically; you may need to add the component first. Once Multipass is added and specified in your TransportManager add whichever other transports you wish to support. Drag the added reference of each transport to **Transports** under Multipass.

{% hint style="warning" %}
Be sure that each transport within Multipass is listening on a different port.
{% endhint %}

![Setup example](/files/DixvlpQ3D68RmiRzD6E4)

## Client

A client may only use one transport within Multipass, while the server may listen on all the transports at once.

For client actions to work you must specify which transport to use for the client.

```csharp
// This can be done easily using the TransportManager.
Multipass mp = transportManager.GetTransport<Multipass>();

// In this example if the build is a webGL build
// then use Bayou, otherwise use Tugboat.

#if UNITY_WEBGL && !UNITY_EDITOR
mp.SetClientTransport<Bayou>();
#else
mp.SetClientTransport<Tugboat>();
#endif
```

The example above shows using Bayou and Tugboat, but you may of course use your own logic for any number of transports.

Once a client transport is set you may perform functions normally as if you were using only one transport. An example of this would be: ClientManager.StartConnection().

## Server

As covered in the [component settings](/docs/fishnet-building-blocks/transports/multipass.md#component-settings) *GlobalServerActions* will execute server actions on all transports specified within Multipass. If you were to call ServerManager.StartConnection() while *GlobalServerActions* is true then the server would start on all transports; otherwise an error will be thrown.

```csharp
// Start all servers transports. This requires GlobalServerActions to be true.
serverManagerReference.StartConnection();
```

You may also access functions on a single transport by specifying the index of which transport to use.

```csharp
// Start the connection on index 0.
Multipass mp = TransportManager.GetTransport<Multipass>();
// The true parameter is to indicate you are starting a server.
mp.StartConnection(true, 0);
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://fish-networking.gitbook.io/docs/guides/features/transports/multipass.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
