[GH-ISSUE #38] Running termpair serve defaults to port 80 but termpair share uses port 8000? #15

Closed
opened 2026-03-03 01:21:10 +03:00 by kerem · 1 comment
Owner

Originally created by @1Mark on GitHub (May 31, 2021).
Original GitHub issue: https://github.com/cs01/termpair/issues/38

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

Originally created by @1Mark on GitHub (May 31, 2021). Original GitHub issue: https://github.com/cs01/termpair/issues/38 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 <module> 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
kerem closed this issue 2026-03-03 01:21:10 +03:00
Author
Owner

@cs01 commented on GitHub (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.

<!-- gh-comment-id:851733254 --> @cs01 commented on GitHub (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 in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termpair#15
No description provided.