FireFox renders html page on port 80, but lists html on port 8080. 에 대한 최근 답변https://support.mozilla.org/ko/questions/12364632018-10-13T00:41:38-07:00Hi Jscher2000, Amazingly, that solved the problem!! FireFox now displays the webpage on port 9000. I2018-10-13T00:41:38-07:00Jim44685https://support.mozilla.org/ko/questions/1236463?page=2#answer-1163874<p>Hi Jscher2000, Amazingly, that solved the problem!! FireFox now displays the webpage on port 9000. It still is a mystery why it always worked on port 80, but was "picky" on the other ports. The last few days were certainly frustrating at times. Anyway, thanks a lot for your help. JimK
</p>Hi Jim44685, thank you for the screenshot. It's puzzling because there's no "Response Headers" secti2018-10-12T10:02:34-07:00jscher2000https://support.mozilla.org/ko/questions/1236463?page=2#answer-1163736<p>Hi Jim44685, thank you for the screenshot. It's puzzling because there's no "Response Headers" section (and there's no response code at the left end of the request line) and yet there is text in your browser from the host. Firefox is just not understanding it to be HTML.
</p><p>I searched for <code>srv=net.createServer(net.TCP)</code> and found some examples. Could you try adding a line to this section of your code:
</p><pre> --Buffer is sent in smaller chunks as due to limited memory ESP8266 cannot handle more than 1460 bytes of data.
<strong>client:send('HTTP/1.1 200 OK\n\n');</strong>
client:send(html_buffer);
client:send(html_buffer1);
client:close();
</pre>
<p>Hopefully that will lead Firefox to assume it is HTML.
</p>OK, here is what I got back, see pix... I've changed things back to the "original" settings. Local i2018-10-12T09:23:24-07:00Jim44685https://support.mozilla.org/ko/questions/1236463?page=2#answer-1163728<p>OK, here is what I got back, see pix... I've changed things back to the "original" settings. Local is 192.168.0.176:80 and remote is <a href="http://n8pxw.no-ip.org:9000" rel="nofollow">n8pxw.no-ip.org:9000</a>. So you can use your browser with the Network Monitor in FireFox and view the results, if I left anything out.
</p>Hi Jim44685, here is a screenshot illustrating how to view the Response Headers for a request listed2018-10-12T03:59:25-07:00jscher2000https://support.mozilla.org/ko/questions/1236463?page=2#answer-1163649<p>Hi Jim44685, here is a screenshot illustrating how to view the Response Headers for a request listed in the Network Monitor panel, and the particular one that I'm interested in.
</p>I have no idea what you're talking about. Here is a <shft><ctl>E screen of the attempt a2018-10-12T03:43:48-07:00Jim44685https://support.mozilla.org/ko/questions/1236463#answer-1163645<p>I have no idea what you're talking about. Here is a &lt;shft&gt;&lt;ctl&gt;E screen of the attempt at 192.168.0.176:9000.
</p>I'm running EPS8266 environment, the script is in LUA.
--Small demo of internet/network controlled r2018-10-12T03:34:51-07:00Jim44685https://support.mozilla.org/ko/questions/1236463#answer-1163638<p>I'm running EPS8266 environment, the script is in LUA.
</p><pre>--Small demo of internet/network controlled relay using ESP8266 (ESP-01) module and 2 channel optoisolated relay board
</pre>
<p>--Made by Sandeep Vaidya @ Robokits India - <a href="http://www.robokits.co.in" rel="nofollow">http://www.robokits.co.in</a> for demo.
</p><p>--Configure relay ouutput pins, pins are floating and relay opto needs ground to be activated. So pins are kept high on startup.
Relay1 = 3
Relay2 = 4
gpio.mode(Relay1, gpio.OUTPUT)
gpio.write(Relay1, gpio.HIGH);
gpio.mode(Relay2, gpio.OUTPUT)
gpio.write(Relay2, gpio.HIGH);
</p><p>wifi.setmode(wifi.STATION) --Set network mode to station to connect it to wifi router. You can also set it to AP to make it a access point allowing connection from other wifi devices.
</p><p>--Set a static ip so its easy to access
cfg = {
</p><pre> ip="192.168.0.176",
netmask="255.255.255.0",
gateway="192.168.0.1"
}
</pre>
<p>wifi.sta.setip(cfg)
</p><p>--Your router wifi network's SSID and password
wifi.sta.config("TRENDnet","")
--Automatically connect to network after disconnection
wifi.sta.autoconnect(1)
print ("\r\n")
--Print network ip address on UART to confirm that network is connected
print(wifi.sta.getip())
--Create server and send html data, process request from html for relay on/off.
srv=net.createServer(net.TCP)
srv:listen(9000,function(conn) --change port number if required. Provides flexibility when controlling through internet.
</p><pre> conn:on("receive", function(client,request)
local html_buffer = "";
local html_buffer1 = "";
</pre>
<p><br>
</p><pre> local _, _, method, path, vars = string.find(request, "([A-Z]+) (.+)?(.+) HTTP");
if(method == nil)then
_, _, method, path = string.find(request, "([A-Z]+) (.+) HTTP");
end
local _GET = {}
if (vars ~= nil)then
for k, v in string.gmatch(vars, "(%w+)=(%w+)&amp;*") do
_GET[k] = v
end
end
</pre>
<p> html_buffer = html_buffer.."&lt;meta charset='\"utf-8\"'&gt;";
html_buffer = html_buffer.."&lt;title&gt;Robokits IOT Server&lt;/title&gt;</p><p><b>&lt;font face=\"Arial Black\" size=\"6\" color=\"#0000FF\"&gt;&lt;marquee behavior=\"alternate\" bgcolor=\"#FFFF00\"&gt;ROBOKITS IOT SERVER &lt;/marquee&gt;&lt;/font&gt;</b></p>";
html_buffer = html_buffer.."";
html_buffer1 = html_buffer1.."";
html_buffer1 = html_buffer1.."<table><tbody><tr><td><b>";
html_buffer = html_buffer.."&lt;font face=\"Verdana\" size=\"2\" color=\"#FFFF99\"&gt;RELAY1&lt;/font&gt;</b></td><td><b>&lt;font face=\"Verdana\" size=\"2\" color=\"#FFFF99\"&gt;RELAY2&lt;/font&gt;</b></td></tr><tr><td><a href='\"?pin=ON1\"' rel="nofollow">&lt;button&gt;&lt;font face=\"Verdana\"&gt;<b>ON</b>&lt;/button&gt;&lt;/font&gt;</a></td><td><a href='\"?pin=ON2\"' rel="nofollow">&lt;button&gt;&lt;font face=\"Verdana\"&gt;<b>ON</b>&lt;/button&gt;&lt;/font&gt;</a></td></tr><tr><td><a href='\"?pin=OFF1\"' rel="nofollow">&lt;button&gt;&lt;font face=\"Verdana\"&gt;<b>OFF</b>&lt;/button&gt;&lt;/font&gt;</a></td><td><a href='\"?pin=OFF2\"' rel="nofollow">&lt;button&gt;";
html_buffer1 = html_buffer1.."&lt;font face=\"Verdana\"&gt;<b>OFF</b>&lt;/button&gt;&lt;/font&gt;</a></td></tr></tbody></table><p><b>&lt;font face=\"Verdana\"&gt;Visit our website : <a href='\"http://www.robokits.co.in\"' rel="nofollow">http://www.robokits.co.in </a>&lt;/font&gt;</b></p>";
<p></p><p><br>
</p><pre> local _on,_off = "",""
if(_GET.pin == "ON1")then
gpio.write(Relay1, gpio.LOW);
elseif(_GET.pin == "OFF1")then
gpio.write(Relay1, gpio.HIGH);
elseif(_GET.pin == "ON2")then
gpio.write(Relay2, gpio.LOW);
elseif(_GET.pin == "OFF2")then
gpio.write(Relay2, gpio.HIGH);
end
--Buffer is sent in smaller chunks as due to limited memory ESP8266 cannot handle more than 1460 bytes of data.
</pre>
<p> client:send(html_buffer);
</p><pre> client:send(html_buffer1);
client:close();
collectgarbage();
end)
</pre>
<p>end)
</p>Are you checking the Content-Type header in the Network Monitor, or just Page Info? Please check the2018-10-11T09:04:34-07:00jscher2000https://support.mozilla.org/ko/questions/1236463#answer-1163394<p>Are you checking the Content-Type header in the Network Monitor, or just Page Info? Please check the Content-type header for working and non-working ports.
</p>I get HTML back from this site. It says my 9000 port is open and working. OK, I have a zinger for y2018-10-11T07:41:32-07:00Jim44685https://support.mozilla.org/ko/questions/1236463#answer-1163377<p>I get HTML back from this site. It says my 9000 port is open and working. OK, I have a zinger for you. I set the webserver to 192.168.0.176:9000. Firefox says "plain" and only lists the HTML. Now, I use the router NAT port forwarding to map 192.168.0.176:9000 to <a href="http://n8pxw.no-ip.org:80" rel="nofollow">n8pxw.no-ip.org:80</a>. Guess what? The page renders in FireFox and it reports type "html".
</p>As far as I know, Firefox is not limited to ports 80 and 443. For example, the cPanel for my web hos2018-10-11T06:53:02-07:00jscher2000https://support.mozilla.org/ko/questions/1236463#answer-1163366<p>As far as I know, Firefox is not limited to ports 80 and 443. For example, the cPanel for my web hosting account is accessed on port 2083 and that works fine.
</p><p>I found this interesting page to try nearly any port number you like. Do you get HTML from this site or only plain text?
</p><p><a href="http://portquiz.net:9000/" rel="nofollow">http://portquiz.net:9000/</a>
</p>You need a port forwarding 91.xxx.xxx.71:80 to 91.xxx.xxx.71:80.80
2018-10-11T02:31:19-07:00AnnaSycamorehttps://support.mozilla.org/ko/questions/1236463#answer-1163314<p>You need a port forwarding 91.xxx.xxx.71:80 to 91.xxx.xxx.71:80.80
</p>What software are you running? IIS, Ngix, Lamp, Mamp, Wamp, NodeJS (express), Apache Tomcat?
You 2018-10-11T02:07:50-07:00AnnaSycamorehttps://support.mozilla.org/ko/questions/1236463#answer-1163312<p>What software are you running? IIS, Ngix, Lamp, Mamp, Wamp, NodeJS (express), Apache Tomcat?
You need to configure your software to listen that port
The default port are listed here:
<a href="https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml" rel="nofollow">https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml</a>
</p>OK, here is the current rundown. I switched relay webservers to 192.168.0.176:80 and port forwarded 2018-10-11T01:30:06-07:00Jim44685https://support.mozilla.org/ko/questions/1236463#answer-1163305<p>OK, here is the current rundown. I switched relay webservers to 192.168.0.176:80 and port forwarded <a href="http://n8pxw.no-ip.org:9000" rel="nofollow">n8pxw.no-ip.org:9000</a> to it. I wanted to see if something was wrong with the server. I used the network monitor tool. On port 80 it said "HTML" on port 9000 "plain". Some one said maybe it's no-ip, so I tried my external ip, "91.xxx.xxx.71:9000. No luck, so it's not no-ip. OK, maybe the router is changing the type. I went thru the process on setting up another router from a different manufacturer, a PITA. Same results. Finally I changed the port on the webserver to 9000. So I connected my PC directly to the webserver, no router, and the network monitor said "plain". The webserver doesn't care what port it uses. After chasing my tail for 3 days, it has become clear that my original observation is correct "Firefox only renders web pages on port 80, by default". What I need is an authoritative answer, from a developer,programmer, or code maintainer, can this default be changed, or is firefox wedded to port 80, one of over 65,000 ports available?
</p>Somewhere between your web server, your router, and the redirect service, it seems that the "text/ht2018-10-10T05:57:42-07:00jscher2000https://support.mozilla.org/ko/questions/1236463#answer-1163075<p>Somewhere between your web server, your router, and the redirect service, it seems that the "text/html" content type sent by the server is getting stripped or changed to "text/plain" instead. Firefox needs the text/html content-type header to render it as HTML. Earlier in this thread, we suggested ways to view the content-type header to confirm what your Firefox is receiving to see whether this is the problem (for example, using the Network Monitor tool). I don't know whether you ever did that.
</p>Hello,
Yes but you are on port 9000 See your image
The ports are only numbers They can serve what 2018-10-10T05:17:12-07:00AnnaSycamorehttps://support.mozilla.org/ko/questions/1236463#answer-1163064<p>Hello,
Yes but you are on port 9000 See your image
The ports are only numbers They can serve what you want if they are configured correctly for that.
Some of them are considered default for specific tasks.
The port 80 is a default http port for a web client.
8080 is a HTTP alternate port and the default HTTP for Apache TomCat
</p><p><br>
Hope this help
</p>OK, I've added the recommended header to identify the character encoding, still no luck. Any more id2018-10-10T01:08:47-07:00Jim44685https://support.mozilla.org/ko/questions/1236463#answer-1162983<p>OK, I've added the recommended header to identify the character encoding, still no luck. Any more ideas? The page still renders locally from the server port 80.
</p>Hello,
I can't edit code there
The page is from sitepoint
https://www.sitepoint.com/a-basic-html5-t2018-10-08T06:39:36-07:00AnnaSycamorehttps://support.mozilla.org/ko/questions/1236463#answer-1162484<p>Hello,
I can't edit code there
The page is from sitepoint
<a href="https://www.sitepoint.com/a-basic-html5-template/" rel="nofollow">https://www.sitepoint.com/a-basic-html5-template/</a>
read the article carefully and put attention to the standard elements of the html page
Hope this help
</p>Hello
ADD
<meta charset="utf-8"> after your head declaration note the tags and the word meta 2018-10-08T06:32:48-07:00AnnaSycamorehttps://support.mozilla.org/ko/questions/1236463#answer-1162482<p>Hello
<strong>ADD</strong>
&lt;meta charset="utf-8"&gt; after your head declaration note the tags and the word meta
Hope this help!
</p>I think Firefox works the same way with port 80 and 8080. 8080 is not an unusual port for a web or p2018-10-08T05:24:30-07:00jscher2000https://support.mozilla.org/ko/questions/1236463#answer-1162462<p>I think Firefox works the same way with port 80 and 8080. 8080 is not an unusual port for a web or proxy server.
</p><p>When you access the page locally on port 80, is the server sending the text/html Content-Type header? cor-el provided a link earlier on how to check that using the Network Monitor (click the request and view Response Headers on the right side) or the Page Info dialog (on the General panel, the "Type").
</p>
<hr>
<p>If you don't get a solution here, you could submit a support ticket about the problem and see whether it's a known issue: <a href="https://www.noip.com/ticket/" rel="nofollow">https://www.noip.com/ticket/</a>
</p>The webserver sits at 192.168.0.175 and services port 80. FireFox renders the webpage on the local i2018-10-08T05:02:30-07:00Jim44685https://support.mozilla.org/ko/questions/1236463#answer-1162455<p>The webserver sits at 192.168.0.175 and services port 80. FireFox renders the webpage on the local intranet. For internet access my router connects my external IP port 8080 to this internal server address. Therefore the server has no idea of the external port number. It's FireFox that's seeing the port changing from 80 to 8080 when I try to render the webpage externally. There has to be some setting in FireFox to allow webpages to be rendered from ports other than 80.
</p>Hi Jim44685, the problem there is the "plain text document" part.
You want Firefox to interpret the 2018-10-08T04:44:36-07:00jscher2000https://support.mozilla.org/ko/questions/1236463#answer-1162448<p>Hi Jim44685, the problem there is the "plain text document" part.
</p><p>You want Firefox to interpret the file as HTML, not plain text. IE has a developer crutch: it sniffs file content and overrides the content-type header in some cases. Firefox doesn't do that.
</p><p>Your web server normally associates a content type of text/html with web pages based on extension (e.g., index.html, index.htm, default.html, default.htm, all served with a content-type of text/html). Or if you use PHP or another rendering engine, it will generate the correct content-type header.
</p><p>What's odd is that your hosts on the different ports don't have the identical configuration when it comes to MIME types. Is that easy to find/compare in your web server settings?
</p>