# Module BSV::Auth::Transport <a id="module-BSV-Auth-Transport"></a>

Duck-typed interface for BRC-31 message transport.

Concrete transports (HTTP, WebSocket, in-process, etc.) must implement both
methods. Include this module to get the default `NotImplementedError` stubs —
override in your implementation class.

**@example Minimal in-process transport for testing**
```ruby
class DirectTransport
  include BSV::Auth::Transport

  def initialize(peer)
    @peer = peer
  end

  def send(message)
    @peer.handle_incoming_message(message)
  end

  def on_data(&block)
    @on_data = block
  end
end
```

## Public Instance Methods
### `on_data()` <a id="method-i-on_data"></a> <a id="on_data-instance_method"></a>
Registers a callback to be invoked when a message arrives.
- **@raise** [NotImplementedError]
- **@return** [void]
- **@yieldparam** `message` [Hash] the incoming auth message

### `send(_message)` <a id="method-i-send"></a> <a id="send-instance_method"></a>
Sends a message to the remote peer.
- **@param** `message` [Hash] the serialised auth message
- **@raise** [NotImplementedError]
- **@return** [void]
