Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webtty on web example does not work? #5

Open
arjenpdevries opened this issue Nov 14, 2018 · 17 comments
Open

Webtty on web example does not work? #5

arjenpdevries opened this issue Nov 14, 2018 · 17 comments

Comments

@arjenpdevries
Copy link
Contributor

arjenpdevries commented Nov 14, 2018

In both firefox and chrome, I get an error at https://maxmcd.github.io/webtty/, whenever I try to paste the offer message...

InvalidParameterError: Empty or null SDP provided to setLocalDescription
InvalidStateError: setRemoteDescription not called
@maxmcd
Copy link
Owner

maxmcd commented Nov 14, 2018

Can you paste your offer message?

@maxmcd
Copy link
Owner

maxmcd commented Nov 14, 2018

Actually, if you could email it to me. Email addr is on my github profile.

@arjenpdevries
Copy link
Contributor Author

I will send you one, but really any offer triggers the same problem (it already breaks as soon as I start typing).

@arjenpdevries
Copy link
Contributor Author

Ping

@ViktorBarzin
Copy link

I'm having this issue. I have the same error in Firefox and in chrome the error I have is:

OperationError: Failed to execute 'setRemoteDescription' on 'RTCPeerConnection': Failed to parse SessionDescription. Expect line: v= InvalidStateError: Failed to execute 'createAnswer' on 'RTCPeerConnection': PeerConnection cannot create an answer in a state other than have-remote-offer or have-local-pranswer.

This error occurs on key any press - I don't even think it recognizes the entire offer I paste in :/

@ViktorBarzin
Copy link

UPDATE: I looked into the source the issue appears to be a missing decode function in the startSession function:

image

Furthemore, to get it connect to a session you need to put your offer in the url as a hash argument - e.g: http://localhost:8080/#connection_data

image

I'm not sure whether the on("data" function parses the paste correctly since if refreshes the term as soon as a key is pressed which may not be what we need.

@maxmcd
Copy link
Owner

maxmcd commented Jan 18, 2019

The url hash was intended as a convenience, it shouldn't be required.

@maxmcd
Copy link
Owner

maxmcd commented Jan 18, 2019

The encode and decode functions are defined within webassembly. They are here: https://github.com/maxmcd/webtty/blob/master/web-client/src/main.go#L60-L63
(Webassembly can't mutate the global javascript state by itself but wasm_exec.js allows Go to call into the browser context)

If there was an error loading the webassembly those functions would not be available, but assuming success decode and encode should be available on the window object.

Appreciate you looking into this, I still haven't been able to reproduce on my end, will look into it again.

@ViktorBarzin
Copy link

Thanks for the quick reply!

This is my system information, hopefully it helps:

Fedora 29, kernel 4.19.13-300 all up to date.
Docker version 18.09.1, build 4c52b90
docker-compose version 1.22.0, build f46880f

Running docker-compose up builds everything successfully (Though it complains about the nodejs version so I had to remove it manually to download the latest):

Successfully built 403eef497ede
Successfully tagged maxmcd/webtty-client:latest
Starting webtty_web-client_1 ... done
Recreating webtty_base_1     ... done
Attaching to webtty_web-client_1, webtty_base_1
webtty_base_1 exited with code 0
web-client_1  | 172.20.0.1 - - [18/Jan/2019:13:39:40 +0000] "GET / HTTP/1.1" 200 263 "-" "curl/7.61.1" "-"

Any clues would be much appreciated,
Thanks

@arjenpdevries
Copy link
Contributor Author

Hmmmm... I also run fedora, one system was fc28 the other fc29. Will try to test again soon.

@ViktorBarzin
Copy link

Hey @arjenpdevries,
Any updates? :)

@rivertam
Copy link

This seems to imply to me that WebTTY is just unusable for some/all users? I can't get an example working and I don't know how to resolve it at all.

@maxmcd
Copy link
Owner

maxmcd commented Apr 18, 2019

@rivertam maybe!

I can get it working, this issue seems to (weirdly) be limited to Fedora. What kind of issue are you experiencing? (Feel free to open another issue or email me 😃 )

@maxmcd maxmcd changed the title Webtty on web example does not work? Webtty on web example does not work? (on fedora?) Apr 18, 2019
@rivertam
Copy link

I'm actually experiencing this on Ubuntu with the exact same issues as above. I didn't look into this properly when I commented -- I'll see if there are errors in the console tomorrow.

@arjenpdevries arjenpdevries changed the title Webtty on web example does not work? (on fedora?) Webtty on web example does not work? May 13, 2019
@arjenpdevries
Copy link
Contributor Author

Given the report with Ubuntu above, it does not seem related to the linux distribution:
#5 (comment)

@maxmcd
Copy link
Owner

maxmcd commented Jun 14, 2019

Hey guys, mind checking this out with the new release?

@ozskywalker
Copy link

ozskywalker commented Dec 5, 2022

If I right-click and paste, instead of trying a ctrl-v in the window, the demo works. Suspect it's just the web client that's having this problem due to changes there.

edit: oops, just saw the fix above. my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants