Closed ltfschoen closed 1 year ago
This is kind of confusing. For one this is more of a Trunk issue than Kobold, but even then you probably don't want to use Trunk as a server in production. I suppose you can configure it to bind to 0.0.0.0
instead of 127.0.0.1
for it to be accessible remotely, but it really only should used for its intended purpose: as a dev server with hot reloading on code changes.
If I run this on my local machine which is macOS by following the README.md instructions by installing Rust and running:
Then it outputs
server listening at http://127.0.0.1:8080
And when I go to http://127.0.0.1:8080 in my web browser it displays:Hello Kobold!
However, if I try to run it on a remote machine. The output said, and went to http://:8080, but it also returned error
server listening at http://127.0.0.1:8080
But when I went to view the website in my web browser by going to http://127.0.0.1:8080, but it returned errorERR_CONNECTION_REFUSED
. So I instead I found the IP address of the remote server I was running Kobold on, which wasERR_CONNECTION_REFUSED
. So I went through the process of checking if I had a firewall blocking port 8080, but I didn't. So then I tried running a different web server on port 8080 by runningnpx -y http-server
in the examples/hello_world/dist/ directory, which output:And when I opened http://:8080 in my web browser it displayed: :8080 in my web browser it displayed:
Hello Kobold!
But I don't want to have to run a JS server to access Kobold, so then I thought it may require a custom Trunk server configuration. So I rantrunk serve --help
, and found there was an--address
option So I rantrunk serve --address <REMOTE_IP_ADDRESS>
and then when I opened http://Hello Kobold!
And when I rancurl -v http://<REMOTE_IP_ADDRESS>:8080
from a different browser tab, it responded with the HTML. However when I rancurl -v http://127.0.0.1:8080
it refused to connect.On my local machine if I ran
trunk serve --open
it automatically opened http://127.0.0.1:8080 in my browser, but if I rantrunk serve --address <REMOTE_IP_ADDRESS> --open
on my remote machine via ssh, whilst it ran the server, it also output:ERROR error opening browser error=Custom { kind: Other, error: "gio: http://<REMOTE_IP_ADDRESS>:8080/: Operation not supported (exit status: 2)" }
Suggest updating the README.md instructions to mention how to handle remote machine usage. Also need to figure out how to run Trunk so that it's served on both 127.0.0.1 (localhost) + remote IP at the same time