Author Topic: Web server not working  (Read 4143 times)

mr14

  • Newbie
  • *
  • Posts: 12
    • View Profile
Web server not working
« on: June 13, 2017, 08:40:59 AM »
I tried to add a simple web server element to my project but I can't access it with the web server.
I tried to change the TCP port to 8080 or 8008 but still can't access it.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Web server not working
« Reply #1 on: June 13, 2017, 08:45:32 AM »
Are you trying to view it on a remote PC or the same PC running AdvancedHMI?

mr14

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Web server not working
« Reply #2 on: June 13, 2017, 08:46:42 AM »
I tried both.
Didn't work on either of them

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Web server not working
« Reply #3 on: June 13, 2017, 08:54:40 AM »
Try turning off your firewall. Can you run a Wireshark capture to see if the request is received?

mr14

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Web server not working
« Reply #4 on: June 14, 2017, 06:53:18 AM »
I turned off firewall. Still not connecting.
Attached is a wireshark capture file. the PC that runs the HMI is 10.10.0.105

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5262
    • View Profile
    • AdvancedHMI
Re: Web server not working
« Reply #5 on: June 14, 2017, 09:13:22 AM »
There is a SYN followed by a RST, ACK which means the PC is not listening on port 8080.

Double check your SimpleWebServer and make sure TCPPort is 8080. Also check SourceForm to make sure it is set to something and AutoStart is set to True.

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Web server not working
« Reply #6 on: June 14, 2017, 11:22:09 AM »
in my case, IE is working with the simple webserver, but not Chrome browser.

192.168.1.253 sent an invalid response.
ERR_INVALID_HTTP_RESPONSE

and Firefox is not rendering correctly:
<html xmlns : msxsl = "urn:schemas-Microsoft - com: xslt"  meta content="en-us" http-equiv="Content-Language" /> <meta content="text/html; charset=utf-16" http-equiv="Content-Type" /> <meta http-equiv="refresh" content="10"> <img src="data:image/png;base64,iVBORw0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A/nLPqWWi3XlceejWw8pDN+1ZTtj5SQLICOFulP73HF86DDDAAAMMMLAmGmit8C+5vZx5yXUrpcW8ewLICMuzwy4HlHe/b4uRWzx/lPfYd3nmLylnzl9ctfi/s1XBofr9iOPPmLQsBx9xYjn9omvHXnNxzeNHnjgWQqrHoo1NMwJJx7Srn7uXZ+QAcsGVt5RhLQJI93PivgWzn1H+UoWOaA/dOrsKHnuVh5Z8qTx01cfKkf9vnVYAGTbt0R8/qfzfTT9ddjlr+PKOPs0VPa1VYRlX9Hs2vZXnTd/rewYYYICB1dvATrOOLldUK/znXHrDSmkx71iGtrNRlyfCx0MPPTRyi+eP8h77Lc9ZVUCb3K5v/X72Jde3wkP38sTv+80+tsypQsgRx/2i9vHj51zUem3vtJfNq3t5+v099mwBufCqpWVY63f8x9wD1mtt7Wi1xduXB6/6eHnw0n8rD1782nLQto9tBZBh0/7e195TNv7ayUOfd+FVJ5fPVQFk17OHL++wec7c453L2G95u58z5P0fu3PZuPW+Lym7blk9d9NoO5fvjTBuY++z83WDX9sai9b0q7bl7HJixzwGPTZz/dnksbZsxp0BBhhggIGZNtBa4b/ujnJuFUBWRltYzTuWof0+2wHk3EtvrJanf4sV/AcffHDkFs8/q1rZHzbdheOBqHN5Fl5/R3X18hvK2QuuH/u//fOCKrRVLUJIXSCK+/Y95Ed9Hzvi+DmtAHL2+HTGAlJ1ocZqPtHi/ph3Z//089ATQC66+tYyrLWCxN89ppz1orXLyS98XDnuBWNbN07Z88nV1o6Pt1oEjz/Pe1358wUvLn8+55ll1qeq51fPGTjtcw4rH95y5/K5qs0euhyntALIbucMX95h72fmHu9cxn7L2/ucD2/Z730tKLtVjy17fOp9cOL+O0/qsxP3/3QVLg4rJ3b19+wdqtCxwykT49X5+6DHZq4vmzzOls24M8AAAwwwkGEgVm4XXnf70BXzYSvu0338ivEV7PZ7bS1Pdd95l900sMXK/Z/+9KeRWzx
« Last Edit: June 14, 2017, 11:25:40 AM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Web server not working
« Reply #7 on: April 09, 2018, 10:12:04 PM »
This header seems to work fine for Google Chrome on port 80:

Code: [Select]
            Dim header As String =
                "<html xmlns : msxsl = ""urn:schemas-Microsoft - com: xslt""  meta content=""en-us"" http-equiv=""Content-Language"" /> " & _
                 "<meta content=""text/html; charset=utf-16"" http-equiv=""Content-Type"" /> " & _
                 "<meta http-equiv=""Content-Security-Policy"" content=""Upgrade-Insecure-Requests"" /> " & _
                 "<meta http-equiv=""refresh"" content=""" & CStr(m_RefreshTime) & """> "

It can be used to replace the current header inside Private Sub ConnectionAccepted(ar As IAsyncResult).

It didn't work on port 8080.
« Last Edit: April 09, 2018, 10:15:40 PM by Godra »

Tazmahal

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Web server not working
« Reply #8 on: April 16, 2018, 03:39:55 AM »
Hi Godra !

Is there a possibility to view it on a IPhone or android ?

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Web server not working
« Reply #9 on: April 16, 2018, 09:40:14 AM »
Google Chrome is available for both platforms.

I tried it on Android tablet and it worked fine.

Tazmahal

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Web server not working
« Reply #10 on: April 17, 2018, 12:17:38 AM »
Maybe it's an apple issues , works fine on computer but still get ERR_INTERNET_DISCONNECTED when browsing with my phone..!

*Tested with a co worker android and it works fine , apple again... ::)
« Last Edit: April 17, 2018, 03:44:00 AM by Tazmahal »

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Web server not working
« Reply #11 on: April 17, 2018, 09:52:31 AM »
It could be the limitation of the Apple mobile hardware but maybe Google Developers might need to look into it as well.

For those who have access to an iPad or mac computer, they might test this just to eliminate the iPhone as the cause.

All the SimpleWebServer component is trying to do is serve a simple image to a browser.
Alternatively, one could try a different browser, an example of which could be: https://www.mozilla.org/en-US/firefox/mobile/

Tazmahal

  • Newbie
  • *
  • Posts: 27
    • View Profile
Re: Web server not working
« Reply #12 on: April 17, 2018, 11:05:26 AM »
Yeah I’ve tried firefox , Microsoft Edge , puffin whith no succes..!

Godra

  • Hero Member
  • *****
  • Posts: 1438
    • View Profile
Re: Web server not working
« Reply #13 on: June 04, 2019, 12:56:06 AM »
There is also another header in this topic: https://www.advancedhmi.com/forum/index.php?topic=2399.msg14351#msg14351

Whatever works for any particular setup...