StopHTTP

Discussion to talk about software related topics only.
Post Reply
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

StopHTTP

Post by SeeCwriter »

I'm guessing that if StartHTTPs() is used, that StopHTTP() does not stop accepting connections on port 80? Is there a way to do that without turning off the SSL port after the HTTPs task is running?
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: StopHTTP

Post by TomNB »

Hello,

Tool chain version and platform?

HTTPS is on port 443, not 80. Can you describe what it is you are trying to accomplish by stopping the web server beyond just turning it off? And are you using HTTP, HTTPS, or both?

You can just start the HTTPS web server and not port 80 if you wish.
SeeCwriter
Posts: 606
Joined: Mon May 12, 2008 10:55 am

Re: StopHTTP

Post by SeeCwriter »

I'm using v2.9.5. StartHTTPs takes two arguments to set the two ports, one for the secure port (default of 443), and one for the open port (default of 80). If you start the HTTPS without arguments, as I do, you can use both ports. On the other hand, StartHTTP only uses an insecure connection. Plus there is a companion function that will stop HTTP if you want to disable webpage usage. There is no equivalent StopHTTP function for HTTPS.

We have customers that want to be able to turn off the unsecure port for security reasons. And we have customers that only want to use the unsecure port, they don't care about the secure port. So I would like to use HTTPS, and be able to turn off the unsecure port when it's not desired, and turn it on when it is. All without having to have two different builds of the firmware.
User avatar
TomNB
Posts: 538
Joined: Tue May 10, 2016 8:22 am

Re: StopHTTP

Post by TomNB »

Rather than starting everything up and then stopping, the cleanest way would be to not start the HTTP server in the first place. You can do that by passing a 0 as the port number.

StartHttps(443, 0) will only start the HTTPS server

So when you device boots the application can choose to call StartHttp(), StartHttps(), or StartHttps(443, 0) depending on how they want the system to operate.
Post Reply