[][src]Function tungstenite::server::accept_hdr

pub fn accept_hdr<S: Read + Write, C: Callback>(
    stream: S,
    callback: C
) -> Result<WebSocket<S>, HandshakeError<ServerHandshake<S, C>>>

Accept the given Stream as a WebSocket.

This function does the same as accept() but accepts an extra callback for header processing. The callback receives headers of the incoming requests and is able to add extra headers to the reply.