golanggohlsrtmpwebrtcmedia-serverobs-studiortcprtmp-proxyrtmp-serverrtprtsprtsp-proxyrtsp-relayrtsp-serversrtstreamingwebrtc-proxy
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
379 B
24 lines
379 B
package base |
|
|
|
import ( |
|
"fmt" |
|
"io" |
|
) |
|
|
|
// HandshakeS0 is the S0 part of an handshake. |
|
type HandshakeS0 struct{} |
|
|
|
// Read reads a HandshakeS0. |
|
func (HandshakeS0) Read(r io.Reader) error { |
|
buf := make([]byte, 1) |
|
_, err := io.ReadFull(r, buf) |
|
if err != nil { |
|
return err |
|
} |
|
|
|
if buf[0] != rtmpVersion { |
|
return fmt.Errorf("invalid rtmp version (%d)", buf[0]) |
|
} |
|
|
|
return nil |
|
}
|
|
|