Phu1237 / vscode-vs-browser

Built-in browser for Visual Studio Code
MIT License
39 stars 3 forks source link

localhost:8000 not rendered with VSCode Remote SSH extension #23

Open bernigf opened 8 months ago

bernigf commented 8 months ago

I'm using VSCode remote SSH extension to edit files from a Django project on a remote VPS, and I'm also using VSCode port forwarding for port 8000.

I'm working on a Django project in my remote VPS, so when I start my server using

python service/manage.py runserver 0.0.0.0:8000

I can load correctly http://localhost:8000 on any browser (Chrome, Firefox, etc) but somehow it does not render in the extension browser.

However I noticed that the request does arrive to the server since I can see this output from the django http server (see also de screenshot)

[16/Jan/2024 16:45:08] "GET / HTTP/1.1" 200 2

Also inspecting the extension browser source code I found this in the console.

reloadIframe: http://localhost:8000
chrome-error://chromewebdata/:1 Refused to display 'http://localhost:8000/' in a frame because it set 'X-Frame-Options' to 'sameorigin'.

The URL request arrives to the server just like from any other web browser but nothing gets rendered in the VSCode-browser pane, just a blank site. I attach also some screenshots that may be useful.

By the way thanks, this is a super useful extension. Keep up the great work!

image image image image
Phu1237 commented 6 months ago

@bernigf Sorry for the late response Can you help me to check if your server is blocking the iframe from other websites? You can try using the Proxy mode + Local Proxy Server or configure X-Frame-Options on your server to allow iframe embedding (just for local testing) Please help me to check it and confirm if it working or not Thank you!