Connect ESP32C3 to replit Python HTTP Server

I’m trying to connect my ESP32C3 XIAO to a python http server. On the microntroller side, I’m using the WiFi library from Arduino, and I’m just using the python http server template on replit. I keep getting a 308 permanent redirect response. (I’m expecting to get the content in templates/index.html).

HTTP/1.1 308 Permanent Redirect
Content-Type: text/html; charset=utf-8
Replit-Cluster: global
Date: Sun, 26 Feb 2023 03:05:13 GMT
Content-Length: 69
Via: 1.1 google

<a href="">Permanent Redirect</a>.

I then tried using the WIFiClientSecure library to use https, but then it just wouldn’t receive anything at all.

Is connecting a microcontroller to an http server possible on replit? If so, why exactly am I getting the redirect response?

Here’s the link to the python server replit:
Repl link:

Here’s my Arduino code that is running on the ESP3C23 XIAO (you’d need to follow the Arduino setup instruction from Getting Started with Seeed Studio XIAO ESP32C3 - Seeed Wiki if you want to run this):

#include <WiFi.h>

WiFiClient client;
const char* ssid     = "ssid";
const char* password = "pass";

const char* server = "";
const uint8_t port = 80;

void connectNetwork(const char* ssid, const char* password) {
    WiFi.begin(ssid, password);
    // wait until connected
    while (WiFi.status() != WL_CONNECTED) {

void connectServer(const char* server, uint8_t port) {

    while (!client.connect(server, port)) {

void setup() {

    connectNetwork(ssid, password);
    connectServer(server, port);

    client.println("GET / HTTP/1.1");
    client.print("Host: ");
    client.println("Connection: disconnect");

void loop() {
    while (client.available()) {
        char c =;
    // if the server's disconnected, stop the client:
    if (!client.connected()) {
        Serial.println("Disconnecting from server.");
        // do nothing forevermore:
        while (true);

I appreciate any help!

You are using http and not https. All repls are forced to use https.
Instead of using in your Arduino code, replace it with to start a secure connection.


As @joecooldoo said, you need to use HTTPS, but adding “https” to the URL won’t work (I think)


-const uint8_t port = 80;
+const uint8_t port = 443;


-    while (!client.connect(server, port)) {
+    while (!client.connectSSL(server, port)) {

Try doing this rather than using WiFiClientSecure. If it still doesn’t work, then your microcontroller may not support TLS.