Links2004 / arduinoWebSockets

arduinoWebSockets
GNU Lesser General Public License v2.1
1.9k stars 555 forks source link

ESP8266+ENC28j60 Secure (WSS) SocketIO support #301

Open alxferraz opened 6 years ago

alxferraz commented 6 years ago

Hi @Links2004! I have been trying to connect to a secure socket.io endpoint. I notice this is only possible using ESP's native wifi. How could I have this type of secure connection using ESP+ENC28J60?

Links2004 commented 6 years ago

Hi,

the easiest way is using for example nginx as proxy to convert wss (https) to ws (http).

the more complex and better way is to register the ENC28J60 in to the TCP stack (lwip) of the ESP, this way the ssl lib and all other TCP / UDP functions on the ESP can be used. there are some ENC28J60 lwip drivers out there but no one has ported them to arduino / ESP yet as far i know.

alxferraz commented 6 years ago

the easiest way is using for example nginx as proxy to convert wss (https) to ws (http).

Since this project I am working on involves a lot of security layers this is not an option for my server/backend. I found this repo espenc but it doesn't suport esp-arduino. Are there any other alternatives?

Links2004 commented 6 years ago

the driver here: https://github.com/Informatic/espenc/tree/master/driver

can be easy be ported to the ESP arduino. only the SPI part and the IRQ handling need to be replaced that is all.

the code hooks already in the lwip stack on the ESP which makes wss possible.

alxferraz commented 6 years ago

https://github.com/Informatic/espenc/issues/3