https://github.com/sunshinev/go-space-chat
通过 canvas 2d 来模拟了 3D 的视觉效果。
并且在该项目中使用了 protobuf 来进行前端和后端的通讯协议,这一点非常方便!
WASD
按键来控制上下左右space
空格可以输入消息,按下回车发送消息最新支持使用 docker-compose 的方式来启动服务,克隆项目后,直接执行下面命令
docker-compose up -d
访问http://localhost:8081
我是已经没域名和服务器了
1
1044523901 353 天前
不错哈
|
2
huguadao 353 天前 via Android
倒真是有匿名聊天室的需求,不过我自己还没想明白要一个怎么样的
|
3
dianso 353 天前
演示没有么
|
4
XanderXu 352 天前
我用 docker 部署后好像不行,页面无法打开
|
5
PlanV 352 天前
针不错,star 了
|
8
sunshinev OP @XanderXu 可以贴下控制台报错内容看下,可以看下是否是 amd64 或者 arm64 的问题,我是在 mac 上,用的 golang 的 arm64 版本。如果宿主机是 amd64 的话,可能会拉取 debain 的 amd64 版本
|
9
sunshinev OP @1044523901 笔芯
|
10
Takashi123 352 天前
直接 go run 是可以启动的,docker 启动就这样了
Traceback (most recent call last): File "/usr/bin/docker-compose", line 11, in <module> load_entry_point('docker-compose==1.25.0', 'console_scripts', 'docker-compose')() File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 72, in main command() File "/usr/lib/python3/dist-packages/compose/cli/main.py", line 125, in perform_command project = project_from_options('.', options) File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 53, in project_from_options return get_project( File "/usr/lib/python3/dist-packages/compose/cli/command.py", line 151, in get_project return Project.from_config( File "/usr/lib/python3/dist-packages/compose/project.py", line 102, in from_config service_networks = get_networks(service_dict, networks) File "/usr/lib/python3/dist-packages/compose/network.py", line 320, in get_networks networks[network.true_name] = netdef File "/usr/lib/python3/dist-packages/compose/network.py", line 125, in true_name self._set_legacy_flag() File "/usr/lib/python3/dist-packages/compose/network.py", line 146, in _set_legacy_flag data = self.inspect(legacy=True) File "/usr/lib/python3/dist-packages/compose/network.py", line 106, in inspect return self.client.inspect_network(self.legacy_full_name) File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 19, in wrapped return f(self, resource_id, *args, **kwargs) File "/usr/lib/python3/dist-packages/docker/api/network.py", line 212, in inspect_network res = self._get(url, params=params) File "/usr/lib/python3/dist-packages/docker/utils/decorators.py", line 46, in inner return f(self, *args, **kwargs) File "/usr/lib/python3/dist-packages/docker/api/client.py", line 230, in _get return self.get(url, **self._set_request_timeout(kwargs)) File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 602, in get return self.request("GET", url, **kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 589, in request resp = self.send(prep, **send_kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/sessions.py", line 703, in send r = adapter.send(request, **kwargs) File "/usr/local/lib/python3.8/dist-packages/requests/adapters.py", line 486, in send resp = conn.urlopen( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 791, in urlopen response = self._make_request( File "/usr/local/lib/python3.8/dist-packages/urllib3/connectionpool.py", line 497, in _make_request conn.request( TypeError: request() got an unexpected keyword argument 'chunked' |
11
julyclyde 352 天前
@Takashi123 这是你 composer 的问题?
|
12
julyclyde 352 天前
|
14
sunshinev OP |
16
XanderXu 352 天前
@sunshinev
[+] Running 2/2 ✔ Network go-space-chat_default Created 0.0s ✔ Container go-space-chat-my_debian_container-1 Started docker logs Get:1 http://deb.debian.org/debian bookworm InRelease [151 kB] Get:2 http://deb.debian.org/debian bookworm-updates InRelease [52.1 kB] Get:3 http://deb.debian.org/debian-security bookworm-security InRelease [48.0 kB] Get:4 http://deb.debian.org/debian bookworm/main amd64 Packages [8780 kB] Get:5 http://deb.debian.org/debian bookworm-updates/main amd64 Packages [6668 B] Get:6 http://deb.debian.org/debian-security bookworm-security/main amd64 Packages [105 kB] Fetched 9143 kB in 12s (735 kB/s) Reading package lists... Done Reading package lists... Done Building dependency tree... Done Reading state information... Done The following additional packages will be installed: ca-certificates git-man krb5-locales less libbrotli1 libbsd0 libcbor0.8 libcurl3-gnutls libedit2 liberror-perl libexpat1 libfido2-1 libgdbm-compat4 libgdbm6 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.5-0 libldap-common libnghttp2-14 libperl5.36 libpsl5 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libssh2-1 libssl3 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 netbase openssh-client openssl patch perl perl-modules-5.36 publicsuffix xauth Suggested packages: gettext-base git-daemon-run | git-daemon-sysvinit git-doc git-email git-gui gitk gitweb git-cvs git-mediawiki git-svn gdbm-l10n krb5-doc krb5-user sensible-utils libsasl2-modules-gssapi-mit | libsasl2-modules-gssapi-heimdal libsasl2-modules-ldap libsasl2-modules-otp libsasl2-modules-sql keychain libpam-ssh monkeysphere ssh-askpass ed diffutils-doc perl-doc libterm-readline-gnu-perl | libterm-readline-perl-perl make libtap-harness-archive-perl The following NEW packages will be installed: ca-certificates git git-man krb5-locales less libbrotli1 libbsd0 libcbor0.8 libcurl3-gnutls libedit2 liberror-perl libexpat1 libfido2-1 libgdbm-compat4 libgdbm6 libgssapi-krb5-2 libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.5-0 libldap-common libnghttp2-14 libperl5.36 libpsl5 librtmp1 libsasl2-2 libsasl2-modules libsasl2-modules-db libssh2-1 libssl3 libx11-6 libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxmuu1 netbase openssh-client openssl patch perl perl-modules-5.36 publicsuffix wget xauth 0 upgraded, 47 newly installed, 0 to remove and 0 not upgraded. Need to get 26.4 MB of archives. After this operation, 127 MB of additional disk space will be used. Get:1 http://deb.debian.org/debian bookworm/main amd64 perl-modules-5.36 all 5.36.0-7 [2815 kB] Get:2 http://deb.debian.org/debian bookworm/main amd64 libgdbm6 amd64 1.23-3 [72.2 kB] Get:3 http://deb.debian.org/debian bookworm/main amd64 libgdbm-compat4 amd64 1.23-3 [48.2 kB] Get:4 http://deb.debian.org/debian bookworm/main amd64 libperl5.36 amd64 5.36.0-7 [4218 kB] Get:5 http://deb.debian.org/debian bookworm/main amd64 perl amd64 5.36.0-7 [239 kB] Get:6 http://deb.debian.org/debian bookworm/main amd64 less amd64 590-2 [131 kB] Get:7 http://deb.debian.org/debian bookworm/main amd64 netbase all 6.4 [12.8 kB] Get:8 http://deb.debian.org/debian-security bookworm-security/main amd64 libssl3 amd64 3.0.11-1~deb12u2 [2019 kB] Get:9 http://deb.debian.org/debian-security bookworm-security/main amd64 openssl amd64 3.0.11-1~deb12u2 [1419 kB] Get:10 http://deb.debian.org/debian bookworm/main amd64 ca-certificates all 20230311 [153 kB] Get:11 http://deb.debian.org/debian bookworm/main amd64 krb5-locales all 1.20.1-2+deb12u1 [62.7 kB] Get:12 http://deb.debian.org/debian bookworm/main amd64 libbsd0 amd64 0.11.7-2 [117 kB] Get:13 http://deb.debian.org/debian bookworm/main amd64 libedit2 amd64 3.1-20221030-2 [93.0 kB] Get:14 http://deb.debian.org/debian bookworm/main amd64 libcbor0.8 amd64 0.8.0-2+b1 [27.4 kB] Get:15 http://deb.debian.org/debian bookworm/main amd64 libfido2-1 amd64 1.12.0-2+b1 [77.2 kB] Get:16 http://deb.debian.org/debian bookworm/main amd64 libkrb5support0 amd64 1.20.1-2+deb12u1 [32.4 kB] Get:17 http://deb.debian.org/debian bookworm/main amd64 libk5crypto3 amd64 1.20.1-2+deb12u1 [78.9 kB] Get:18 http://deb.debian.org/debian bookworm/main amd64 libkeyutils1 amd64 1.6.3-2 [8808 B] Get:19 http://deb.debian.org/debian bookworm/main amd64 libkrb5-3 amd64 1.20.1-2+deb12u1 [332 kB] Get:20 http://deb.debian.org/debian bookworm/main amd64 libgssapi-krb5-2 amd64 1.20.1-2+deb12u1 [134 kB] Get:21 http://deb.debian.org/debian bookworm/main amd64 openssh-client amd64 1:9.2p1-2+deb12u1 [989 kB] Get:22 http://deb.debian.org/debian bookworm/main amd64 libpsl5 amd64 0.21.2-1 [58.7 kB] Get:23 http://deb.debian.org/debian bookworm/main amd64 wget amd64 1.21.3-1+b2 [984 kB] Get:24 http://deb.debian.org/debian bookworm/main amd64 libbrotli1 amd64 1.0.9-2+b6 [275 kB] Get:25 http://deb.debian.org/debian bookworm/main amd64 libsasl2-modules-db amd64 2.1.28+dfsg-10 [20.3 kB] Get:26 http://deb.debian.org/debian bookworm/main amd64 libsasl2-2 amd64 2.1.28+dfsg-10 [59.7 kB] Get:27 http://deb.debian.org/debian bookworm/main amd64 libldap-2.5-0 amd64 2.5.13+dfsg-5 [183 kB] Get:28 http://deb.debian.org/debian bookworm/main amd64 libnghttp2-14 amd64 1.52.0-1 [72.3 kB] Get:29 http://deb.debian.org/debian bookworm/main amd64 librtmp1 amd64 2.4+20151223.gitfa8646d.1-2+b2 [60.8 kB] Get:30 http://deb.debian.org/debian bookworm/main amd64 libssh2-1 amd64 1.10.0-3+b1 [179 kB] Get:31 http://deb.debian.org/debian-security bookworm-security/main amd64 libcurl3-gnutls amd64 7.88.1-10+deb12u4 [385 kB] Get:32 http://deb.debian.org/debian bookworm/main amd64 libexpat1 amd64 2.5.0-1 [99.3 kB] Get:33 http://deb.debian.org/debian bookworm/main amd64 liberror-perl all 0.17029-2 [29.0 kB] Get:34 http://deb.debian.org/debian bookworm/main amd64 git-man all 1:2.39.2-1.1 [2049 kB] |
17
Takashi123 352 天前
@julyclyde #11 我 check 一下
|
18
julyclyde 352 天前
@Takashi123 composer 古代版本是 python 的。后来改成 golang 的了。再然后变成 docker 命令的 plugin 了
|