How can I start the browser AFTER the server started listening?

Open the listener, start the browser and then enter the server loop: l, err := net.Listen(“tcp”, “localhost:3000”) if err != nil { log.Fatal(err) } // The browser can connect now because the listening socket is open. err := open.Start(“http://localhost:3000/test”) if err != nil { log.Println(err) } // Start the blocking server loop. log.Fatal(http.Serve(l, r)) There’s … Read more

Golang. What to use? http.ServeFile(..) or http.FileServer(..)?

The main difference is that http.FileServer does effectively almost 1:1 mapping of an HTTP prefix with a filesystem. In plain english, it serves up an entire directory path. and all its children. Say you had a directory called /home/bob/static and you had this setup: fs := http.FileServer(http.Dir(“/home/bob/static”)) http.Handle(“/static/”, http.StripPrefix(“/static”, fs)) Your server would take requests … Read more

Apache is not running from XAMPP Control Panel ( Error: Apache shutdown unexpectedly. This may be due to a blocked port)

There are many possible answers for this problem. The most common and most likely is that you’re running another program which is blocking port 80 or 443. If you’ve installed Skype, then you’ve found your problem! Change apache’s port settings to 81 and apache will work. There’s a good tutorial on that To check this … Read more

prevent direct url access to php file

You can do it with PHP <?php /* at the top of ‘check.php’ */ if ( $_SERVER[‘REQUEST_METHOD’]==’GET’ && realpath(__FILE__) == realpath( $_SERVER[‘SCRIPT_FILENAME’] ) ) { /* Up to you which header to send, some prefer 404 even if the files does exist for security */ header( ‘HTTP/1.0 403 Forbidden’, TRUE, 403 ); /* choose the … Read more

Is there any possible ways to bypass cloudflare security checks?

When you visit a site which is protected by cloudflare, it would contain a security check which you cannot bypass and on failing eventually your access is denied and you are redirected to the captcha challenge page due to the requests from low reputation IP addresses. IP Reputation is calculated based on Project Honeypot, external … Read more