8000 Same endpoint for REST Host and Web UI lightning terminal · Issue #1178 · jamaljsr/polar · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Same endpoint for REST Host and Web UI lightning terminal #1178

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

Open
timkaebisch opened this issue Apr 7, 2025 · 1 comment
Open

Same endpoint for REST Host and Web UI lightning terminal #1178

timkaebisch opened this issue Apr 7, 2025 · 1 comment

Comments

@timkaebisch
Copy link

In my network, I have a node running "Terminal v0.14.1-alpha."
I'm attempting to use the API to, for example, call DecodeAssetPayReq.

I am using the sample code exactly as provided in the documentation. However, I am receiving the following response:

<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/icons/favicon-32x32.png"/><meta name="theme-color" content="#000000"/>....<link rel="manifest" href="/manifest.json"/><title>Lightning Terminal</title><script defer="defer" src="/static/js/main.f878aaa8.js"></script><link href="/static/css/main.488ab95f.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html>

I suspect this is happening because the Web UI is on the same endpoint as the REST backend (in my case, 127.0.0.1:8443).

How can I resolve this conflict?

@timkaebisch
Copy link
Author

I figured out what was causing the issue.

In my setup, I'm running "Terminal v0.14.1-alpha." Internally, litd is configured with (by default):

--lnd-mode=integrated
--lnd.restlisten=0.0.0.0:8080

So the REST API (e.g. for taproot-assets) is served on port 8080 inside the container.

What I didn’t realize initially is that Polar maps this internal port to a different external one on the host machine. In my case, it’s mapped like this (which I found in docker desktop):

8381 (host) → 8080 (container)

I was sending requests to localhost:8443, which is actually the Lightning Terminal Web UI, not the REST API. That explains the HTML response I was getting. Once I changed my API requests to go to localhost:8381 instead, it worked as expected — including the DecodeAssetPayReq call.

So just a heads up for anyone else running into the same issue: make sure you’re targeting the correct mapped port for the REST API, not the Web UI.

@jamaljsr Can you confirm this? Is there a small bug in the docs under the 'Connect' section for the Node with REST Host, where the listed port doesn't match the actual exposed port?

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

No branches or pull requests

1 participant
0