weblink icon indicating copy to clipboard operation
weblink copied to clipboard

Hosting a basic html page

Open datee opened this issue 3 years ago • 3 comments

I'm trying to host a super simple html page:

<html>
<body>
<h1>Hello</h1>
<img src="picture.jpg" />
</body>
</html>

The image is always broken, and the page doesnt stop loading.. but if i open the image link it in a new browser tab it works fine. Also, if refreshing the same image many times in a tab it will sometimes just not load.. Is this somehow related to requesting multiple files? Any way to work around it?

var app = new Weblink();
app.serve("/","d:/files_root");
app.listen(2000);

datee avatar Mar 18 '23 11:03 datee

I have heard before about this type of problem with the web server. I think there is a bug in the webserver with regards to the current connection state and refreshing temporary fixes it. I'll try to find some time to fix it.

PXshadow avatar Mar 25 '23 07:03 PXshadow

Thanks. Im experiencing this problem all the time here with weblink, even for .get(..) Usually i have to load the link two times for it to work. Otherwise nothing is happening and the link / page just loads and loads and dont stop. I've tried debugging the problem but i cant find the source of the problem, since it seems there is no data in the socket...

Your description of the problem sounds correct, hope you can find a fix for it, otherwise its not really usable at this point. (At least for me, dont know if everyone have the same issue but..)

If it helps, im on Windows, using chrome and Haxe 4.2.5, HL 1.12

datee avatar Mar 28 '23 08:03 datee

I tested your example and I cannot reproduce it. I'm on Haxe 4.3.3, HL 1.12.0, Ubuntu 22.04.

Both the HTML page and the image loaded as expected on Firefox 115 ESR and Chromium 119.

Can you reproduce it on a fresh Windows install?

9Morello avatar Dec 14 '23 13:12 9Morello