Closed
Description
Hi, I'm a newbie to pion.
I run the examples with go run examples.go
under webrtc/examples
While I tried the broadcast by accessed the url http://localhost/example/js/broadcast/
on Chrome browser, I got the Browser base64 Session Description
.
The question is how to generate the Golang base64 Session Description
.
Could anybody help me?
Thanks a lot
Activity
Sean-Der commentedon Feb 11, 2020
Hi @juexun
Thanks for checking out Pion! You can generate it by running
curl localhost:8080/sdp -d "Browser SDP"
then the broadcast binary will print it to stdout.broadcast has more documentation around it. Please re-open or reach out on Slack if you have more questions.
thanks
RathanakSreang commentedon Feb 13, 2020
@Sean-Der I also fact this issue.
And I try follow your command above but it still does not work.
Sean-Der commentedon Feb 13, 2020
@RathanakSreang are you running the curl command on the same computer you ran broadcast/main.go?
Thanks
RathanakSreang commentedon Feb 13, 2020
@Sean-Der Yes, I do. But the result i got is just HTML code instead.
Sean-Der commentedon Feb 13, 2020
Something else is listening on :8080 then. Probably examples.go ? I would use the JSFiddle link in the broadcast README, and make sure nothing else is running.
robmunro-sg commentedon Sep 30, 2020
I've just tried this on the lastest trunk branch - I also just get the raw HTML
using: go run examples.go --address localhost:8080
then curl localhost:8080/sdp -d "Browser SDP"
NickThorne123 commentedon Nov 28, 2020
OK so I was having a mental block about where $BROWSER_SDP comes from. So will explain here for the benefit of others.
Say you want to run the reflect example, then open the reflect jsfiddle page linked from here. Click on the text [A] from the box called "Browser base64 Session Description". Then go back into the linux bash shell / osx terminal where you have installed the webrtc examples and done a
export GO111MODULE=on go get github.com/pion/webrtc/v3/examples/reflect
Now in the examples/reflect directory, enter
echo $BROWSER_SDP | reflect
where $BROWSER_SDP is the text [A] we copied from the jsfiddle "Browser base64 Session Description" box.
The terminal will then print another base64 string which we past into the other box in the jsfiddle page.
Should work now...
elibenjii commentedon Jan 12, 2021
Hi, curl localhost:8080/sdp -d "Browser SDP". not working for me, it shows:
curl: (7) Failed to connect to localhost port 8080: Connection refused
Thank you
AlexanderMatveev commentedon Mar 20, 2021
curl localhost:8080/sdp -d "Browser SDP"
Gives
done
in stdout and panic in application:Because
Decode
func expects valid base64 string with JSON inside.Sean-Der commentedon Mar 20, 2021
Hey @AlexanderMatveev you don't want to send

"Browser SDP"
but the base64 value in the textareaSean-Der commentedon Mar 20, 2021
If you get a chance would you mind updating the docs to be more descriptive? This has confused multiple people, not sure of a better way to work it though.
AlexanderMatveev commentedon Mar 20, 2021
@Sean-Der Thanks for response, I got it from code. But I didn't found any information about where must I get this base64-string.
Update examples/broadcast README
3 remaining items