项目作者: abobija

项目描述 :
Simple Esp32 DNS Hijack Server, packaged as ESP-IDF component
高级语言: C
项目地址: git://github.com/abobija/esp-dns-hijack-srv.git
创建时间: 2019-12-27T18:45:11Z
项目社区:https://github.com/abobija/esp-dns-hijack-srv

开源协议:MIT License

下载


esp-dns-hijack-srv

Esp32 DNS Hijack Server, packaged as ESP-IDF component.

This is simple DNS server that resolves all lookups to one IP address. Handy for use to open Captive Portal.

Demo

Esp32 DNS Hijacking

How to use

This directory is an ESP-IDF component. Clone it (or add it as submodule) into components directory of the project.

Example

In this example all requested domains will be forwarded to the IP address 192.168.4.1

  1. ip4_addr_t resolve_ip;
  2. inet_pton(AF_INET, "192.168.4.1", &resolve_ip);
  3. if(dns_hijack_srv_start(resolve_ip) == ESP_OK) {
  4. ESP_LOGI(TAG, "DNS hijack server started");
  5. } else {
  6. ESP_LOGE(TAG, "DNS hijack server has not started");
  7. }