diff options
author | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2023-03-16 18:37:12 +0900 |
---|---|---|
committer | Nguyễn Gia Phong <mcsinyx@disroot.org> | 2023-03-16 18:37:12 +0900 |
commit | 3ad35832835fa0554b6fa28b74e9b7d21283392b (patch) | |
tree | 41f44e442e964e0ec0da38392b5518bd9f964989 /src/http.cr | |
parent | 64c3842e02e65bb173d275e4ac2cdbea5afcf562 (diff) | |
download | hybring-3ad35832835fa0554b6fa28b74e9b7d21283392b.tar.gz |
Diffstat (limited to 'src/http.cr')
-rw-r--r-- | src/http.cr | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/http.cr b/src/http.cr index 9562c2e..95a3069 100644 --- a/src/http.cr +++ b/src/http.cr @@ -36,13 +36,18 @@ def http_error(context, status, message = nil) end class Server + @sock : String + def initialize(cfg) + @sock = cfg.sock @db = Database.new cfg.db, cfg.opennic_remote, cfg.icann_remote @opennic_host = URI.parse(cfg.opennic_remote).host - @opennic_page = Page.new cfg.opennic_local, cfg.opennic_remote, cfg.api, @db + @opennic_page = Page.new cfg.opennic_local, cfg.opennic_remote, + cfg.opennic_api, cfg.css, @db @opennic_page.write - @icann_page = Page.new cfg.icann_local, cfg.icann_remote, cfg.api, @db + @icann_page = Page.new cfg.icann_local, cfg.icann_remote, + cfg.icann_api, cfg.css, @db @icann_page.write @server = HTTP::Server.new do |context| @@ -140,7 +145,7 @@ class Server end }, self.as Void* - yield @server.bind_tcp port + yield @server.bind_unix @sock @server.listen end |