Giter Site home page Giter Site logo

dns-scanner's Issues

Runtime error when accessing API URL

After compiling the code as described and starting the HTTP server, I get a runtime error whenever I access the API
http://myip:10000/api/fqd.dns

2023/10/10 16:22:48 http: panic serving server_ip:53029: runtime error: invalid memory address or nil pointer dereference
goroutine 5 [running]:
net/http.(*conn).serve.func1()
/usr/lib/go/src/net/http/server.go:1854 +0xbf
panic({0x724760, 0x9ec190})
/usr/lib/go/src/runtime/panic.go:890 +0x263
dnsScanner/workers.ScanDns({0xc000094009, 0x7})
/root/source/go/dns-scanner/workers/dnsScanner.go:45 +0x30d
main.scanDns({0x807b50, 0xc0000ae000}, 0xc00008c1e0?)
/root/source/go/dns-scanner/main.go:18 +0x85
net/http.HandlerFunc.ServeHTTP(0xc000092300?, {0x807b50?, 0xc0000ae000?}, 0x800?)
/usr/lib/go/src/net/http/server.go:2122 +0x2f
github.com/gorilla/mux.(*Router).ServeHTTP(0xc000000180, {0x807b50, 0xc0000ae000}, 0xc000092000)
/root/go/pkg/mod/github.com/gorilla/[email protected]/mux.go:210 +0x1cf
net/http.serverHandler.ServeHTTP({0xc00008c030?}, {0x807b50, 0xc0000ae000}, 0xc000092000)
/usr/lib/go/src/net/http/server.go:2936 +0x316
net/http.(*conn).serve(0xc000164090, {0x807d78, 0xc000150c90})
/usr/lib/go/src/net/http/server.go:1995 +0x612
created by net/http.(*Server).Serve
/usr/lib/go/src/net/http/server.go:3089 +0x5ed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.