Update docker file

This commit is contained in:
giongto35 2019-04-04 02:42:03 +08:00
parent 141e092b67
commit 475db9e3ab
2 changed files with 2 additions and 13 deletions

View file

@ -4,5 +4,7 @@ RUN mkdir -p /go/src/github.com/giongto35/game-online
COPY . /go/src/github.com/giongto35/game-online/
# Install server dependencies
RUN apt-get install portaudio19-dev
RUN go get github.com/pions/webrtc
RUN go get github.com/gordonklaus/portaudio
RUN go get github.com/gorilla/mux

13
main.go
View file

@ -3,10 +3,8 @@ package main
import (
"fmt"
"image"
"image/color"
"io/ioutil"
"log"
"math/rand"
"net/http"
"time"
@ -68,17 +66,6 @@ func postSession(w http.ResponseWriter, r *http.Request) {
w.Write([]byte(localSession))
}
func randomImage(width, height int) *image.RGBA {
img := image.NewRGBA(image.Rectangle{image.Point{0, 0}, image.Point{width, height}})
for x := 0; x < width; x++ {
for y := 0; y < height; y++ {
img.Set(x, y, color.RGBA{uint8(rand.Int31n(0xff)), uint8(rand.Int31n(0xff)), uint8(rand.Int31n(0xff)), 0xff - 1})
}
}
return img
}
func screenshotLoop(imageChannel chan *image.RGBA) {
for image := range imageChannel {
if webRTC.IsConnected() {