diff options
author | Anton Evangelatov <anton.evangelatov@gmail.com> | 2018-07-12 21:42:45 +0800 |
---|---|---|
committer | Balint Gabor <balint.g@gmail.com> | 2018-07-12 21:42:45 +0800 |
commit | f7d3678c28c4b92e45a458e4785bd0f1cdc20e34 (patch) | |
tree | ef72674417528413ce869f55762f16611b9a0e5f /swarm/swarm.go | |
parent | facf1bc9d66cbe4bb5492486a6fd876a13eeb31b (diff) | |
download | go-tangerine-f7d3678c28c4b92e45a458e4785bd0f1cdc20e34.tar go-tangerine-f7d3678c28c4b92e45a458e4785bd0f1cdc20e34.tar.gz go-tangerine-f7d3678c28c4b92e45a458e4785bd0f1cdc20e34.tar.bz2 go-tangerine-f7d3678c28c4b92e45a458e4785bd0f1cdc20e34.tar.lz go-tangerine-f7d3678c28c4b92e45a458e4785bd0f1cdc20e34.tar.xz go-tangerine-f7d3678c28c4b92e45a458e4785bd0f1cdc20e34.tar.zst go-tangerine-f7d3678c28c4b92e45a458e4785bd0f1cdc20e34.zip |
swarm/api/http: http package refactoring 1/5 and 2/5 (#17164)
Diffstat (limited to 'swarm/swarm.go')
-rw-r--r-- | swarm/swarm.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/swarm/swarm.go b/swarm/swarm.go index 90360264e..431d57a70 100644 --- a/swarm/swarm.go +++ b/swarm/swarm.go @@ -388,10 +388,9 @@ func (self *Swarm) Start(srv *p2p.Server) error { // start swarm http proxy server if self.config.Port != "" { addr := net.JoinHostPort(self.config.ListenAddr, self.config.Port) - go httpapi.StartHTTPServer(self.api, &httpapi.ServerConfig{ - Addr: addr, - CorsString: self.config.Cors, - }) + server := httpapi.NewServer(self.api, self.config.Cors) + + go server.ListenAndServe(addr) } log.Debug(fmt.Sprintf("Swarm http proxy started on port: %v", self.config.Port)) |