Files
mimiclaw/main/proxy/http_proxy.h
crispyberry 82f93b617b refactor: remove NVS/CLI config, use mimi_secrets.h as sole configuration method
All configuration is now done exclusively through mimi_secrets.h at build time.
Removed NVS read/write logic, CLI config commands (wifi_set, set_tg_token,
set_api_key, set_model, set_proxy, clear_proxy, set_search_key), and setter
functions from all modules. CLI retains debug/maintenance commands only.
Updated all documentation to reflect the change.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-07 23:04:24 +08:00

39 lines
1.1 KiB
C

#pragma once
#include "esp_err.h"
#include <stddef.h>
#include <stdbool.h>
/**
* Initialize proxy module.
*/
esp_err_t http_proxy_init(void);
/**
* Returns true if a proxy host:port is configured.
*/
bool http_proxy_is_enabled(void);
/* ── Proxied HTTPS connection ─────────────────────────────────── */
typedef struct proxy_conn proxy_conn_t;
/**
* Open an HTTPS connection through the configured proxy.
* 1) TCP connect to proxy
* 2) Send HTTP CONNECT to target host:port
* 3) TLS handshake over the tunnel
*
* Returns NULL on failure.
*/
proxy_conn_t *proxy_conn_open(const char *host, int port, int timeout_ms);
/** Write raw bytes through the TLS tunnel. Returns bytes written or -1. */
int proxy_conn_write(proxy_conn_t *conn, const char *data, int len);
/** Read raw bytes from the TLS tunnel. Returns bytes read or -1. */
int proxy_conn_read(proxy_conn_t *conn, char *buf, int len, int timeout_ms);
/** Close and free the connection. */
void proxy_conn_close(proxy_conn_t *conn);