mahrud / caddy-altonions

Opportunistic Onions plugin for Caddy
Apache License 2.0
21 stars 0 forks source link

Unexpected token '{', expecting argument #2

Open ioistired opened 5 years ago

ioistired commented 5 years ago

To compile this, I followed these steps:

  1. go get github.com/mholt/caddy/caddy
  2. go get github.com/caddyserver/builds
  3. go get github.com/mahrud/caddy-altonions
  4. Apply this patch in $GOPATH/src/github.com/mholt/caddy:

    diff --git a/caddy/caddymain/run.go b/caddy/caddymain/run.go
    index e17fdde..528e3bb 100644
    --- a/caddy/caddymain/run.go
    +++ b/caddy/caddymain/run.go
    @@ -38,6 +38,7 @@ import (
    
    _ "github.com/mholt/caddy/caddyhttp" // plug in the HTTP server type
    // This is where other plugins get plugged in (imported)
    +   _ "github.com/mahrud/caddy-altonions"
    )
    
    func init() {
    diff --git a/caddyhttp/httpserver/plugin.go b/caddyhttp/httpserver/plugin.go
    index 4abcbbb..5987c76 100644
    --- a/caddyhttp/httpserver/plugin.go
    +++ b/caddyhttp/httpserver/plugin.go
    @@ -658,6 +658,7 @@ var directives = []string{
    "gopkg",     // github.com/zikes/gopkg
    "restic",    // github.com/restic/caddy
    "wkd",       // github.com/emersion/caddy-wkd
    +   "altonions",
    }
    
    const (
  5. go run build.go from $GOPATH/src/github.com/mholt/caddy/caddy
  6. ./caddy -plugins (lists http.altonions)
  7. ./caddy

Here's my Caddyfile:

68.235.48.108:28691

tls off
altonions vldaiehepzaljmwnet2gu77fzpialo2jtkx5znujn6ybcxeqq3utf6qd.onion:28691 {
    ma 300
    persist 0
}

I get this error: Caddyfile:4 - Error during parsing: Unexpected token '{', expecting argument.

What should I do?

mkg20001 commented 5 years ago
+   "altonions",

should be

+   "altonions"