HTML "IMG SRC" with non-standard port

Community Forums/General Help/HTML "IMG SRC" with non-standard port

BlitzSupport(Posted 2011) [#1]
According to what I've read, the HTML IMG tag's SRC can be a full URL with special port, eg. http://www.hi-toro.com:9080/boing.png.

I've created a very simple page here -- forum won't link due to colon in URL -- [ http://www.hi-toro.com:9080/2dserver.html ], and the HTML is below:

<html> 
<title>2D server</title> 
<head> 
<script type="text/JavaScript"> 
<!--
function timedRefresh(timeoutPeriod) {
	setTimeout("location.reload(true);",timeoutPeriod);
}
//   -->
</script> 
</head> 
<body onload="JavaScript:timedRefresh(5000);"> 
Game in progress at 15 FPS on server with no display...
<P> 
<img src="http://www.hi-toro.com:9080/boing.png" width=640 height=480> 
<P> 
Javascript should refresh view every 5 seconds; reload page if not. 
</body> 
</html> 


However, this results in a "broken" image. If you take the image URL directly and paste it into the browser (ie. http://www.hi-toro.com:9080/boing.png ), it works fine (note that it will intentionally fail if you refresh within 2 seconds or so). Running on a local server, it appears that the browser doesn't even try to request the image, only the HTML file. (This is before I even get to parsing the URL requested, where I substitute "boing.png" with a custom render.)

Any ideas what might be wrong? I've tried it with the file name alone, localhost/boing.png, localhost:9080/boing.png, but nothing works. As far as I can tell, the HTML is valid, but my HTML skills are almost non-existent...

(I can't use port 80, BTW!)


GfK(Posted 2011) [#2]
Its working for me.

http://www.desktopgaming.net/test.htm

[edit] My version works - yours doesn't. I'm using PHP 5.2.17

Last edited 2011


BlitzSupport(Posted 2011) [#3]

My version works - yours doesn't. I'm using PHP 5.2.17



Wow, so it does. That makes no sense, since the HTML file obviously gets served up OK (by my own server). It's weird, as it serves up images fine with 'normal' image URLs, ie. local image files contained in the same folder as the HTML file.

Looks like it must somehow be my server code, though. Many thanks for that!