Download the PHP package noglitchyo/dealdoh without Composer
On this page you can find all versions of the php package noglitchyo/dealdoh. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download noglitchyo/dealdoh
More information about noglitchyo/dealdoh
Files in noglitchyo/dealdoh
Package dealdoh
Short Description A simple DNS over HTTPS proxy built on PHP.
License MIT
Informations about the package dealdoh
Dealdoh
Play with DNS over HTTPS and much more!
Dealdoh is a DNS-over-HTTPS (DoH) proxy and a library around DNS messaging written in PHP.
Overview
This library gives ability to proxy DoH requests and/or to send DNS queries with standard UDP/TCP and various modern and secure DNS protocols like DNSCrypt, DNS-over-HTTPS (DoH), GoogleDNS.
It attempts to achieve the following goals:
- provide high-compatibility with a large variety of DNS protocols.
- provide a well-designed abstraction layer for development around DNS in PHP.
Features
- [x] DoH proxy middleware PSR-15/PSR-7 compliant.
- [x] Create and forward DNS messages to different type of DNS upstream resolvers.
- [x] Forward DNS query through multiple DNS upstream resolvers.
- [x] Compatible with DNS protocols: RFC-1035 (Plain DNS over TCP/UDP), RFC-8484 (DoH), Google DoH API, DNSCrypt
- [x] Abstraction layer around DNS development.
- [x] Parse DNS stamps
Client
dealdoh-client is a CLI utility which offers a ready-to-use implementation of this library to send and forward DNS queries.
Library
Requirements
- PHP 7.3
- Web server
- Optional: HTTPS enabled with valid certificates (self-signed certificates can work but it depends of the DOH client making the queries)
Installation
-
Run
composer require noglitchyo/dealdoh
DohResolverMiddleware::forward()
method consumes PSR-7 ServerRequest. Some compatible implementations which can be used:- https://github.com/Nyholm/psr7 -
composer require nyholm/psr7
- https://github.com/guzzle/psr7 -
composer require guzzle/psr7
- https://github.com/zendframework/zend-diactoros -
composer require zendframework/zend-diactoros
- https://github.com/Nyholm/psr7 -
- Configure your application to call
DohResolverMiddleware::forward()
- Testing the installation
As recommended in RFC-8484, usually, DoH client/server will send/receive DNS requests on the path: /dns-query
.
Your application should be configured to listen on this route.
A large variety of DoH client exists than can be used to test the installation.
- dealdoh-client
- Using client from Web Browser
Mozilla Firefox provides a Trusted Recursive Resolver who can be configured to query DoH servers. This article from Daniel Stenberg provides a lot of details about TRR and how to configure it. Please check also the browser implementations list.
Example
More examples
Checkout some really simple integration examples to get a glimpse on how it can be done:
- Slim Framework integration
- DoH + Docker + DNS + Hostname Discovery
- dealdoh-client
Testing
If you wish to run the test, checkout the project and run the test with:
composer test
Contributing
Get started here CONTRIBUTING.md.
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- https://github.com/reactphp/dns
- https://github.com/mageddo/dns-proxy-server
- https://github.com/facebookexperimental/doh-proxy
- https://github.com/DNSCrypt/dnscrypt-proxy
References
All versions of dealdoh with dependencies
ext-json Version *
ext-sockets Version *
nyholm/psr7 Version ^1.1
php Version ^7.3
psr/http-client Version *
psr/log Version ^1.1
psr/http-server-middleware Version ^1.0
php-http/guzzle6-adapter Version ^2.0
react/dns Version ^1.3.0