Skip to content
Snippets Groups Projects
Commit e5bc5358 authored by Pratik Lagaskar's avatar Pratik Lagaskar
Browse files

import blacklist module

parent 29027de1
Branches
No related tags found
1 merge request!3Fixed entry point for the library
package main
import (
"net/http"
"strings"
"main/blacklist"
"time"
"0xacab.org/leap/vpn-hole/blacklist"
"github.com/miekg/dns"
)
var privBlacklist = blacklist.New(httpClient)
var httpClient = &http.Client{Timeout: 30 * time.Second}
var PrivBlacklist = blacklist.New(httpClient)
func isBlacklisted(req *dns.Msg) bool {
func IsBlacklisted(req *dns.Msg) bool {
if req.Opcode != dns.OpcodeQuery {
return false
}
......@@ -26,5 +30,5 @@ func isBlacklisted(req *dns.Msg) bool {
return false
}
return privBlacklist.Contains(strings.TrimRight(q.Name, "."))
return PrivBlacklist.Contains(strings.TrimRight(q.Name, "."))
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment