diff --git a/wsecho/Dockerfile b/wsecho/Dockerfile new file mode 100644 index 0000000..8fb0244 --- /dev/null +++ b/wsecho/Dockerfile @@ -0,0 +1,15 @@ +FROM golang:1.18-bullseye + +WORKDIR /opt +COPY wsecho.patch . + +RUN apt-get update && apt-get install -y patch && \ + git clone https://github.com/gorilla/websocket.git -b v1.5.0 && \ + patch -n websocket/examples/chat/client.go < wsecho.patch && \ + cd websocket && \ + go install -v ./examples/chat + +FROM debian:bullseye + +COPY --from=0 /go/bin/chat /usr/local/bin/wsecho +CMD ["/usr/local/bin/wsecho"] diff --git a/wsecho/README.md b/wsecho/README.md new file mode 100644 index 0000000..df7621f --- /dev/null +++ b/wsecho/README.md @@ -0,0 +1,5 @@ +# wsecho + +This Dockerfile builds a slightly patched version of the [Gorilla "chat" example](https://github.com/gorilla/websocket/tree/78cf1bc733a927f673fd1988a25256b425552a8a/examples/chat). +The patch removes the message size limit as many messages contain the whole shared state. +That should be okay if access to the server is restricted. diff --git a/wsecho/wsecho.patch b/wsecho/wsecho.patch new file mode 100644 index 0000000..8f2246b --- /dev/null +++ b/wsecho/wsecho.patch @@ -0,0 +1,2 @@ +61d60 +< c.conn.SetReadLimit(maxMessageSize)