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

Running termpair serve defaults to port 80 but termpair share uses port 8000? #38

Closed
1Mark opened this issue May 31, 2021 · 1 comment · Fixed by #41
Closed

Running termpair serve defaults to port 80 but termpair share uses port 8000? #38

1Mark opened this issue May 31, 2021 · 1 comment · Fixed by #41

Comments

@1Mark
Copy link

1Mark commented May 31, 2021

Seems that somehow termpair share defaults to port 80 somehow

Window 1

$ pipx run termpair serve

INFO: Started server process [218]
INFO: Waiting for application startup.
INFO: Application startup complete.
INFO: Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)

Window 2

$ pipx run termpair share -b

Traceback (most recent call last):
File "/home/mark/.local/pipx/.cache/b0d871b0f692059/bin/termpair", line 8, in
sys.exit(main())
File "/home/mark/.local/pipx/.cache/b0d871b0f692059/lib/python3.8/site-packages/termpair/main.py", line 109, in main
asyncio.get_event_loop().run_until_complete(
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "/home/mark/.local/pipx/.cache/b0d871b0f692059/lib/python3.8/site-packages/termpair/share.py", line 231, in broadcast_terminal
async with websockets.connect(ws_endpoint, ssl=ssl_context) as ws:
File "/home/mark/.local/pipx/.cache/b0d871b0f692059/lib/python3.8/site-packages/websockets/client.py", line 517, in aenter
return await self
File "/home/mark/.local/pipx/.cache/b0d871b0f692059/lib/python3.8/site-packages/websockets/client.py", line 535, in await_impl
transport, protocol = await self._create_connection()
File "/usr/lib/python3.8/asyncio/base_events.py", line 1025, in create_connection
raise exceptions[0]
File "/usr/lib/python3.8/asyncio/base_events.py", line 1010, in create_connection
sock = await self._connect_sock(
File "/usr/lib/python3.8/asyncio/base_events.py", line 924, in _connect_sock
await self.sock_connect(sock, address)
File "/usr/lib/python3.8/asyncio/selector_events.py", line 494, in sock_connect
return await fut
File "/usr/lib/python3.8/asyncio/selector_events.py", line 526, in _sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 111] Connect call failed ('127.0.0.1', 80)

use -p 8000 for both commands fixes the issue, but it makes me wonder if this is a bug or -p should be mandatory?

same issue after running pipx install termpair (so it's not to do with using pipx run)

$ pipx runpip termpair freeze

aiofiles==0.5.0
cffi==1.14.3
click==7.1.2
cryptography==3.1.1
fastapi==0.61.1
h11==0.11.0
pkg-resources==0.0.0
pycparser==2.20
pydantic==1.6.1
six==1.15.0
starlette==0.13.6
termpair==0.1.0.2
uvicorn==0.12.1
websockets==8.1

@cs01
Copy link
Owner

cs01 commented Jun 1, 2021

Thanks for the report. I agree making the default ports match would make it more usable. I'll add in the future, unless someone beats me to it with a pull request.

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

Successfully merging a pull request may close this issue.

2 participants