l7mp / stunner

A Kubernetes media gateway for WebRTC. Contact: info@l7mp.io
https://l7mp.io
MIT License
751 stars 58 forks source link

fix: Make `turncat` build on Windows #111

Closed levaitamas closed 10 months ago

levaitamas commented 10 months ago

As it was mentioned in #81, turncat fails to build on windows.

The build error:

$ CGO_ENABLED=0 go build -ldflags="-s -w" -o turncat cmd/turncat/main.go
# github.com/l7mp/stunner
.\uri.go:172:29: cannot use int(descriptor) (value of type int) as syscall.Handle value in argument to syscall.SetsockoptInt

Proposed fix: Split system specific code and control build process with //go:build directives. Build works on linux/windows. Tested on Windows 10 22H2 and go 1.21.5.

Comments and testers are welcome. :)

levaitamas commented 10 months ago

I will rerun tests once github is back online.. (https://www.githubstatus.com/)

levaitamas commented 10 months ago

I will rerun tests once github is back online.. (https://www.githubstatus.com/)

done