vitorbaptista / shellshare

Live terminal broadcasts
https://shellshare.net
Apache License 2.0
224 stars 23 forks source link

Weird behavior with client and own shellshare server #72

Closed veixus closed 1 year ago

veixus commented 1 year ago

Im testing the shellshare on Ubuntu 22.04 LTS desktop with python 3.10.6

Using the official way to connect and share a terminal works fine with command : curl -sLo shellshare https://get.shellshare.net/ && python3 shellshare

But trying to use my own server causes a python3 traceback and does not work. curl -sLo shellshare https://get.shellshare.net/ && python3 shellshare --server myserver:3000

A workaround is using old python2 that also works: curl -sLo shellshare https://get.shellshare.net/ && python2 shellshare --server myserver:3000

I think the server service running @ https://shellshare.net/ is newer than the code available at github that Im using. We have been using our personal server for a few years now and it has been used for sharing shell commands between teachers and students. I hope the new version will be available here soon too. It causes some confusion and I would like to remove old python2 from my systems.

The tracebacks I get are like this. Im not sure what it is trying to tell me.

Any help would be appreciated. Thanks!


Traceback (most recent call last):
        File "/home/student/shellshare", line 100, in stream_file success = post(conn, url, encoded_str, room, password)
        File "/home/student/shellshare", line 83, in post raise e 
        File "/home/student/shellshare", line 69, in post conn.request('POST', '/%s' % room, data, headers)
        File "/usr/lib/python3.10/http/client.py", line 1282, in request self._send_request(method, url, body, headers, encode_chunked)
        File "/usr/lib/python3.10/http/client.py", line 1328, in _send_request self.endheaders(body, encode_chunked=encode_chunked)
        File "/usr/lib/python3.10/http/client.py", line 1277, in endheaders self._send_output(message_body, encode_chunked=encode_chunked)
        File "/usr/lib/python3.10/http/client.py", line 1037, in _send_output self.send(msg)
        File "/usr/lib/python3.10/http/client.py", line 975, in send self.connect()
        File "/usr/lib/python3.10/http/client.py", line 941, in connect self.sock = self._create_connection(
        File "/usr/lib/python3.10/socket.py", line 824, in create_connection for res in getaddrinfo(host, port, 0, SOCK_STREAM):
        File "/usr/lib/python3.10/socket.py", line 955, in getaddrinfo for res in _socket.getaddrinfo(host, port, family, type, proto, flags): socket.gaierror: [Errno -2] Name or service not known
vitorbaptista commented 1 year ago

Hey @veixus, that's odd. The code in shellshare.net is the same as is in master. Does running python3 shellshare --server http://myserver:3000 works?

veixus commented 1 year ago

Thank you for for this idea. I never thought it could be this! And you are right - it does work with http://myserver:3000

vitorbaptista commented 1 year ago

That's great! Glad it worked.

On another note, I'm curious about your usage of shellshare. Could you email me briefly talking about how you're using it?

edmundlaugasson commented 1 year ago

Hereby I confirm, that I responded to @vitorbaptista via email as current issue was iniated by me and mentioned teaching comes from my practice.