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

Thorium uses port 8000 #1504

Closed
ghost opened this issue Jun 13, 2021 · 12 comments
Closed

Thorium uses port 8000 #1504

ghost opened this issue Jun 13, 2021 · 12 comments
Projects

Comments

@ghost
Copy link

ghost commented Jun 13, 2021

Hello,

Thank you so much for your work on this app. The Internet badly needs a good, cross-platform ebook reader.

I noticed that Thorium uses port 8000 even when it's downloaded as a standalone app.

As a result you can't run code snippets that default to http://localhost:8000/ like Django (a massively popular Python framework), for example.

@llemeurfr
Copy link
Contributor

Hi, our lead dev is currently testing solutions which would allow the removal of the internal http server (which feeds the internal Chromium browser). If successful, this will solve this issue.

I didn't check the current port, but in the short term it could certainly be changed for something unused by major frameworks.

@ghost
Copy link
Author

ghost commented Jun 15, 2021

Amazing, thank you 🙏

@danielweck
Copy link
Member

Thorium uses a library that finds an unused port for launching the HTTP server (aka "streamer"):

async function startStreamer(streamer: Server): Promise<string> {
// Find a free port on your local machine
const port = await portfinder.getPortPromise();

We can set start and end boundaries for the search range, but we cannot exclude commonly-used ports (as far as I know):
https://github.com/http-party/node-portfinder#ports-search-scope

Once the Electron bugs are solved, we will switch to a non-HTTP "streamer":
#1258 (comment)

@llemeurfr
Copy link
Contributor

Looking at https://en.wikipedia.org/wiki/List_of_TCP_and_UDP_port_numbers it is true that finding free places is difficult.

@ghost
Copy link
Author

ghost commented Jun 17, 2021

Do you even need a server?
Plenty of Electron apps don't ship with an active server. They build their projects then run the built files.

@llemeurfr
Copy link
Contributor

@alvinometric see #1258.

@danielweck
Copy link
Member

Do you even need a server?

To complete Laurent's answer: yes, Thorium needs to serve audio/video files via HTTP as streaming media is currently broken in Electron's custom URL protocol handler:
#1258 (comment)
We plan to remove the dependency on a HTTP server in a future Thorium release, once the audio/video bug is fixed.

@ghost
Copy link
Author

ghost commented Jun 18, 2021

Oh, I see.
So the PR that fixes this has been merged but we're still waiting for it to be released as part of Electron 12. Did I understand that correctly?

@danielweck
Copy link
Member

The merged PR enables a new HTTP-less mode in Thorium, which is currently turned off (at build time). We will activate this new feature once video/audio streaming works in Electron registerStreamerProtocol() (I have to run tests against v12 first, and note that Thorium currently builds on v11)

@llemeurfr
Copy link
Contributor

Because we will move to an HTTP-less mode asap, we will close this issue now.

@danielweck
Copy link
Member

It's coming! #1258 (comment)

@danielweck danielweck added this to To do in 1.7.2 via automation Aug 23, 2021
@danielweck danielweck moved this from To do to In progress in 1.7.2 Aug 23, 2021
@ghost
Copy link
Author

ghost commented Aug 23, 2021

👏

@danielweck danielweck moved this from In progress to Done in 1.7.2 Aug 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
1.7.2
Done
Development

No branches or pull requests

2 participants