-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
61d60 | ||
< c.conn.SetReadLimit(maxMessageSize) |