all repos — captcha @ d6b0f36e6ead9c6235590e8a89f02ce8d8b746d0

Go package captcha implements generation and verification of image and audio CAPTCHAs.

example: print the address of server.
Dmitry Chestnykh dmitry@codingrobots.com
Wed, 27 Apr 2011 20:43:43 +0200
commit

d6b0f36e6ead9c6235590e8a89f02ce8d8b746d0

parent

c6bfbfa6e908240c35e1b125f9c9e1ac5b33ba65

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M example/main.goexample/main.go

@@ -2,6 +2,7 @@ // example of HTTP server that uses the captcha package.

package main import ( + "fmt" "github.com/dchest/captcha" "http" "io"

@@ -41,7 +42,8 @@ func main() {

http.HandleFunc("/", showFormHandler) http.HandleFunc("/process", processFormHandler) http.Handle("/captcha/", captcha.Server(captcha.StdWidth, captcha.StdHeight)) - if err := http.ListenAndServe(":8080", nil); err != nil { + fmt.Println("Server is at localhost:8666") + if err := http.ListenAndServe(":8666", nil); err != nil { log.Fatal(err) } }