Support for socket.io interface, initial commit

This commit is contained in:
Martin Boehm
2018-02-06 12:06:30 +01:00
parent ec87f4ed8d
commit b0f163e21c
5 changed files with 159 additions and 6 deletions

View File

@@ -42,6 +42,9 @@ func NewHTTPServer(httpServerBinding string, db *db.RocksDB, mempool *bchain.Mem
r.HandleFunc("/confirmedTransactions/{address}/{lower}/{higher}", s.confirmedTransactions)
r.HandleFunc("/unconfirmedTransactions/{address}", s.unconfirmedTransactions)
// support for testing of socket.io interface
r.PathPrefix("/socket.io/").Handler(http.StripPrefix("/socket.io/", http.FileServer(http.Dir("./server/static/"))))
var h http.Handler = r
h = handlers.LoggingHandler(os.Stderr, h)
https.Handler = h