maxmcd / webtty

Share a terminal session over WebRTC
https://maxmcd.github.io/webtty/
MIT License
2.71k stars 143 forks source link

Error with the offer #53

Open VladislavGatsenko opened 1 month ago

VladislavGatsenko commented 1 month ago

Problem: I am building a webtty binary and then web-client. When I run web-client locally, via python3 -m http.server 8080, the token from webtty on the running server causes an error There was an error with the offer: /Token/ Try entering the message again:

/ Снимок экрана 2024-09-03 в 00 22 27

But if you use maxmcd.github.io/webtty/ then there are no problems, everything works properly. For some reason the web-part built from source behaves like this (everything is ok on gh-pages too).

Log:

user-1@debian-system-1:~$ go version
go version go1.19.8 linux/amd64
user-1@debian-system-1:~$ git clone https://github.com/maxmcd/webtty
Cloning into 'webtty'...
remote: Enumerating objects: 339, done.
remote: Counting objects: 100% (99/99), done.
remote: Compressing objects: 100% (43/43), done.
remote: Total 339 (delta 66), reused 57 (delta 56), pack-reused 240 (from 1)
Receiving objects: 100% (339/339), 1.82 MiB | 4.38 MiB/s, done.
Resolving deltas: 100% (178/178), done.
user-1@debian-system-1:~$ cd webtty
user-1@debian-system-1:~/webtty$ go build
go: downloading github.com/kr/pty v1.1.4
go: downloading github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db
go: downloading github.com/pion/webrtc/v3 v3.1.29
go: downloading golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4
go: downloading github.com/btcsuite/btcutil v0.0.0-20190316010144-3ac1210f4b38
go: downloading github.com/pion/dtls/v2 v2.1.3
go: downloading github.com/pion/datachannel v1.5.2
go: downloading github.com/pion/ice/v2 v2.2.3
go: downloading github.com/pion/interceptor v0.1.10
go: downloading github.com/pion/logging v0.2.2
go: downloading github.com/pion/rtcp v1.2.9
go: downloading github.com/pion/randutil v0.1.0
go: downloading github.com/pion/rtp v1.7.13
go: downloading github.com/pion/sctp v1.8.2
go: downloading github.com/pion/sdp/v3 v3.0.4
go: downloading github.com/pion/srtp/v2 v2.0.5
go: downloading github.com/pion/transport v0.13.0
go: downloading golang.org/x/net v0.0.0-20220401154927-543a649e0bdd
go: downloading github.com/google/uuid v1.3.0
go: downloading github.com/pion/mdns v0.0.5
go: downloading github.com/pion/stun v0.3.5
go: downloading github.com/pion/turn/v2 v2.0.8
go: downloading github.com/pion/udp v0.1.1
go: downloading golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1
go: downloading golang.org/x/term v0.0.0-20210927222741-03fcf44c2211
go: downloading golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e
user-1@debian-system-1:~/webtty$ cd web-client
user-1@debian-system-1:~/webtty/web-client$ npm install
npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated stable@0.1.8: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
npm warn deprecated source-map-url@0.4.1: See https://github.com/lydell/source-map-url#deprecated
npm warn deprecated request-promise-native@1.0.9: request-promise-native has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm warn deprecated rimraf@2.7.1: Rimraf versions prior to v4 are no longer supported
npm warn deprecated har-validator@5.1.5: this library is no longer supported
npm warn deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm warn deprecated abab@2.0.6: Use your platform's native atob() and btoa() methods instead
npm warn deprecated domexception@1.0.1: Use your platform's native DOMException instead
npm warn deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated source-map-resolve@0.5.3: See https://github.com/lydell/source-map-resolve#deprecated
npm warn deprecated w3c-hr-time@1.0.2: Use your platform's native performance.now() and performance.timeOrigin.
npm warn deprecated q@1.5.1: You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other.
npm warn deprecated
npm warn deprecated (For a CapTP with native promises, see @endo/eventual-send and @endo/captp)
npm warn deprecated chokidar@2.1.8: Chokidar 2 does not receive security updates since 2019. Upgrade to chokidar 3 with 15x fewer dependencies
npm warn deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm warn deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm warn deprecated svgo@1.3.2: This SVGO version is no longer supported. Upgrade to v2.x.x.
npm warn deprecated parcel-bundler@1.12.5: Parcel v1 is no longer maintained. Please migrate to v2, which is published under the 'parcel' package. See https://v2.parceljs.org/getting-started/migration for details.
npm warn deprecated xterm@3.8.1: This package is now deprecated. Move to @xterm/xterm instead.
npm warn deprecated core-js@2.6.12: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

added 839 packages, and audited 840 packages in 28s

86 packages are looking for funding
  run `npm fund` for details

60 vulnerabilities (47 moderate, 12 high, 1 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues possible (including breaking changes), run:
  npm audit fix --force

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
user-1@debian-system-1:~/webtty/web-client$ npm run build

> webtty@0.0.2 build
> npm run go-build && parcel build src/index.html --public-url .

> webtty@0.0.2 go-build
> mkdir -p ./dist/ && touch ./dist/foo && rm ./dist/* && GOOS=js GOARCH=wasm go build -o ./dist/main.wasm ./src

✨  Built in 9.54s.

dist/app.fa495f40.js.map     ⚠️  2.62 MB    220ms
dist/app.fa495f40.js          671.88 KB    8.99s
dist/app.aee19e48.css.map       5.27 KB      1ms
dist/app.aee19e48.css           1.43 KB    1.45s
dist/app.47c2c9a1.css.map         366 B      2ms
dist/index.html                   257 B    292ms
dist/app.47c2c9a1.css             135 B    1.40s
user-1@debian-system-1:~/webtty/web-client$ cd dist
user-1@debian-system-1:~/webtty/web-client/dist$ python3 -m http.server 8080
Serving HTTP on 0.0.0.0 port 8080 (http://0.0.0.0:8080/) ...
192.168.50.110 - - [03/Sep/2024 00:21:32] "GET / HTTP/1.1" 200 -
192.168.50.110 - - [03/Sep/2024 00:21:32] "GET /app.aee19e48.css HTTP/1.1" 200 -
192.168.50.110 - - [03/Sep/2024 00:21:32] "GET /app.fa495f40.js HTTP/1.1" 200 -
192.168.50.110 - - [03/Sep/2024 00:21:32] "GET /app.47c2c9a1.css HTTP/1.1" 200 -
192.168.50.110 - - [03/Sep/2024 00:21:32] "GET /app.aee19e48.css HTTP/1.1" 200 -
192.168.50.110 - - [03/Sep/2024 00:21:32] "GET /app.47c2c9a1.css HTTP/1.1" 200 -
192.168.50.110 - - [03/Sep/2024 00:21:32] "GET /app.fa495f40.js HTTP/1.1" 200 -
192.168.50.110 - - [03/Sep/2024 00:21:32] "GET /main.wasm HTTP/1.1" 200 -