[GH-ISSUE #39] Unable to connect to session if not served by localhost #13

Closed
opened 2026-03-03 01:21:10 +03:00 by kerem · 3 comments
Owner

Originally created by @0xphk on GitHub (Jun 1, 2021).
Original GitHub issue: https://github.com/cs01/termpair/issues/39

Hi,

if I start the server with termpair serve --host 192.168.x.x --port 8000 it successfully binds to the correct interface.

The shared session is successful initiated with termpair share --host "http://192.168.x.x/" --port 8000

Browser opens session and server sends HTTP 200 ok (304 for png & js) for every request but the session is always in "connection-pending" state.

If served/shared using localhost instead, it works without issue.

Do I miss something here? Any help appreciated.

Originally created by @0xphk on GitHub (Jun 1, 2021). Original GitHub issue: https://github.com/cs01/termpair/issues/39 Hi, if I start the server with `termpair serve --host 192.168.x.x --port 8000` it successfully binds to the correct interface. The shared session is successful initiated with `termpair share --host "http://192.168.x.x/" --port 8000` Browser opens session and server sends HTTP 200 ok (304 for png & js) for every request but the session is always in "connection-pending" state. If served/shared using localhost instead, it works without issue. Do I miss something here? Any help appreciated.
kerem closed this issue 2026-03-03 01:21:10 +03:00
Author
Owner

@boroveen commented on GitHub (Jun 1, 2021):

As I understand it, this is a software problem and it is a bug. I tried it, and I can say that on one device, for example, the iPhone 6c, it works fine, without problems, but on another phone, corn is the same problem, and from any computer from any browser and distro the same problem. sorry for the mistakes, I am a Russian user and I use a translator

<!-- gh-comment-id:852400214 --> @boroveen commented on GitHub (Jun 1, 2021): As I understand it, this is a software problem and it is a bug. I tried it, and I can say that on one device, for example, the iPhone 6c, it works fine, without problems, but on another phone, corn is the same problem, and from any computer from any browser and distro the same problem. sorry for the mistakes, I am a Russian user and I use a translator
Author
Owner

@boroveen commented on GitHub (Jun 1, 2021):

image image

<!-- gh-comment-id:852402038 --> @boroveen commented on GitHub (Jun 1, 2021): ![image](https://user-images.githubusercontent.com/56752476/120381830-7a15aa80-c312-11eb-8fe8-6c7ad61eb1b0.jpeg) ![image](https://user-images.githubusercontent.com/56752476/120381878-869a0300-c312-11eb-8221-a2554cbe6848.png)
Author
Owner

@cs01 commented on GitHub (Jun 2, 2021):

I was able to reproduce this. The problem here is the browser is using window.crypto to access AES encryption/decryption libraries, which are only available in secure contexts. localhost is a secure context, but ip addresses are not necessarily secure. I will improve the error message, but this is a legitimate error you need to fix.

You will need to run the server with an ssl certificate. TermPair supports this:

termpair serve --keyfile KEYFILE --certfile CERTFILE

see termpair serve --help for more details.

Alternatively, you can run it behind a proxy running https, as is done at https://grassfedcode.com/termpair, for example

<!-- gh-comment-id:852664182 --> @cs01 commented on GitHub (Jun 2, 2021): I was able to reproduce this. The problem here is the browser is using [window.crypto](https://developer.mozilla.org/en-US/docs/Web/API/Window/crypto) to access AES encryption/decryption libraries, which are only available in secure contexts. localhost is a secure context, but ip addresses are not necessarily secure. I will improve the error message, but this is a legitimate error you need to fix. You will need to run the server with an ssl certificate. TermPair supports this: ``` termpair serve --keyfile KEYFILE --certfile CERTFILE ``` see `termpair serve --help` for more details. Alternatively, you can run it behind a proxy running https, as is done at https://grassfedcode.com/termpair, for example
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#13
No description provided.