How to limit HTTPS to one TCP connection?

时间:2016-07-28 20:22:34

标签: http tcp

I'm using uIP along with mbed TLS to run a simple web server on a microcontroller, and host an HTTPS page.

The problem is: my chip only has enough RAM to handle one TLS connection at a time, but Firefox (and Chrome) tries to open multiple connections at once to load the images on the page. If I tell uIP to abort or close additional connections, Firefox assumes an error and gives up loading the rest of the page.

I can tell uIP to limit the total connections to 1, and in that case it just drops new SYN packets if there is already a connection. This actually works, as Firefox will wait and try again until the page is fully loaded. I can't use this a solution however, since I do need to allow more than 1 TCP connection total in order to handle other types of connections (I can serve a regular HTTP web page at the same time, for example). If I could tell uIP to limit connections on a specific port to 1 at a time, that may solve the problem, but I don't think uIP has that capability. I also don't see a way to force uIP to drop certain packets.

I've looked all over the web, but I can't find any information on running a web server using just one TCP connection at a time.

Does anyone have any ideas?

Thanks!

Marlon

1 个答案:

答案 0 :(得分:0)

在您准备好处理之前,请忽略SSL连接。浏览者应该容忍这一点。