GRVYDEV / Lightspeed-webrtc

A RTP -> WebRTC broadcast server for Project Lightspeed.
MIT License
75 stars 31 forks source link

If using default hostadresse it fails as you manually add port 8080 to it #10

Closed Crowdedlight closed 3 years ago

Crowdedlight commented 3 years ago

If you give no argument so it uses the default, then it will use:

addr         = flag.String("addr", "localhost:8080", "http service address")

Which causes this error:

➜ docker run --rm -it --name webrtc-test webrtc-test
Waiting for RTP Packets
listen tcp: address localhost:8080:8080: too many colons in address

I assume the error is caused when it tries to use it in L86:

log.Fatal(http.ListenAndServe(*addr+":8080", nil))

(https://github.com/GRVYDEV/Lightspeed-webrtc/blob/main/main.go#L86) And you manually add 8080 to it.

Probably enough just to remove :8080 from the default argument in L25

GRVYDEV commented 3 years ago

Weird someone else must have added that in there! ;) All jokes aside yeah we can remove the :8080 from the default value and that will solve that problem. I did this because before it required 2 flags of the same address just one with a port and without a port and I missed changing the default value. Good catch!

Crowdedlight commented 3 years ago

Weird someone else must have added that in there! ;) All jokes aside yeah we can remove the :8080 from the default value and that will solve that problem. I did this because before it required 2 flags of the same address just one with a port and without a port and I missed changing the default value. Good catch!

haha fair enough :)

GRVYDEV commented 3 years ago

Fixed :)