owncast: Can't Use With Restream due to Random Echo Not Matched

ERRO[0014] Server closed by error: Err = Random echo is not matched
github.com/yutopp/go-rtmp/handshake.HandshakeWithClient
        /home/bradley/go/pkg/mod/github.com/yutopp/go-rtmp@v0.0.0-20191212152852-4e41609a99bb/handshake/handshake.go:102
github.com/yutopp/go-rtmp.(*serverConn).Serve
        /home/bradley/go/pkg/mod/github.com/yutopp/go-rtmp@v0.0.0-20191212152852-4e41609a99bb/server_conn.go:28
github.com/yutopp/go-rtmp.(*Server).handleConn
        /home/bradley/go/pkg/mod/github.com/yutopp/go-rtmp@v0.0.0-20191212152852-4e41609a99bb/server.go:115
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1373
Failed to handshake
github.com/yutopp/go-rtmp.(*serverConn).Serve
        /home/bradley/go/pkg/mod/github.com/yutopp/go-rtmp@v0.0.0-20191212152852-4e41609a99bb/server_conn.go:31
github.com/yutopp/go-rtmp.(*Server).handleConn
        /home/bradley/go/pkg/mod/github.com/yutopp/go-rtmp@v0.0.0-20191212152852-4e41609a99bb/server.go:115
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:1373

Set this up with restream, in addition to two other streams going out of restream to facebook and youtube.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 43 (43 by maintainers)

Commits related to this issue

Most upvoted comments

Sure! Thanks! Going to merge this into master.

Also, great news! Finally Restream success! haha

Was just able to reproduce it with that setup. Digging into it…

Yup, that’s the one! You’re always welcome to point to my instance, but it makes sense to make sure your setup is happy since I’ve been running it and (aside from whatever happened last night) it’s been functioning ok. So it would be good to make sure this updated branch runs in your environment, too. Though I doubt there’s enough different to make any incompatibilities. A week or so ago we did the great merging of the config files, too, so it’ll be good to make sure your config file is happy with that.

I will see about testing it on Wednesday night, as that’s when the next time I’ll be using it is. But if I get a chance before then, I’ll let you know!

Thanks for working and pursing this! If you ever need me to test something, let me know

Thanks for testing and reporting! So the bug is in the RTMP library https://github.com/yutopp/go-rtmp/blob/9b52215ac9e0edf55aa3be632cdd12b4c36cd4c8/handshake/handshake.go#L102.

According to the wiki page of RTMP:

C2 and S2 are an echo of S1 and C1 respectively, except with the second 4 bytes being the time the respective message was received (instead of 0). After C2 and S2 are received the handshake is considered complete.

Sounds straightforward enough. I’ll fork it and dig into it and see what that means and see if I can fix it. Thanks again, this was a good find! But sorry it didn’t work for you. Next time!