# `Playwriter.Transport`
[🔗](https://github.com/nshkrdotcom/playwriter/blob/v0.1.0/lib/playwriter/transport.ex#L1)

Transport factory and utilities.

Provides a unified interface for creating and working with transports.

# `mode`

```elixir
@type mode() :: :local | :remote | :auto
```

# `transport`

```elixir
@type transport() :: pid()
```

# `healthy?`

```elixir
@spec healthy?(transport()) :: boolean()
```

Check if a transport is healthy.

# `start`

```elixir
@spec start(keyword()) :: {:ok, transport()} | {:error, term()}
```

Start a transport based on configuration.

## Options

- `:mode` - `:local`, `:remote`, or `:auto` (default: `:auto`)
- `:ws_endpoint` - WebSocket URL for remote mode
- `:headless` - boolean, only for local mode (default: true)
- `:auto_discover` - attempt to find remote server in auto mode (default: true)
- `:browser_type` - `:chromium`, `:firefox`, or `:webkit` (default: `:chromium`)

## Auto Mode

In `:auto` mode, the transport will:
1. Use `:remote` if `ws_endpoint` is provided
2. Try to discover a Windows server if running in WSL and headless is false
3. Fall back to `:local` mode

## Examples

    # Local headless browser
    {:ok, transport} = Playwriter.Transport.start(mode: :local, headless: true)

    # Connect to remote server
    {:ok, transport} = Playwriter.Transport.start(
      mode: :remote,
      ws_endpoint: "ws://localhost:3337/"
    )

    # Auto-detect best transport
    {:ok, transport} = Playwriter.Transport.start(mode: :auto)

# `stop`

```elixir
@spec stop(transport()) :: :ok
```

Stop a transport.

# `wsl?`

```elixir
@spec wsl?() :: boolean()
```

Determine if we're running in WSL.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
