I am currently trying to get the stream key from an incoming stream but strangely enough if I turn the entire incoming bytes into a string it does not show the stream key anywhere.
For example, when implementing in Go all I get is this info:
nonprivatflashVer☻▼FMLE/3.0 (compatible; FMSc/1.0)♠swfUrl☻↨rtmp://127.0.0.1/stream♣tcUrl☻↨rtmp://127.0.0.1/stream
Which I can interpret using the RTMP spec based on message size and type, but where is the stream key? For example, my local stream key to test with is:
d319637b-ac26-4fbf-b90d-4d2ea4c4d21f
I was assuming streaming clients would all have the stream key decodable in a similar matter? Where should I look in RTMP spec?
// Read RTMP "connect" message and extract stream key
func ReadRTMPStreamKey(conn net.Conn) (string, error) {
buffer := make([]byte, 4096)
n, err := conn.Read(buffer)
if err != nil {
return "", err
}
// Ensure we only parse the bytes read
data := buffer[:n]
// Debug: Print the raw packet data
fmt.Printf("Raw RTMP Packet: %v\n", data)
stringifiedData := string(data)
fmt.Printf("Stringified Data %v", stringifiedData)
return "asda", nil
}