مراية لـ
https://github.com/postalserver/postal.git
تم المزامنة 2025-12-01 05:43:04 +00:00
support for multiple bind addresses on the fast server
هذا الالتزام موجود في:
@@ -13,12 +13,17 @@ module Postal
|
|||||||
|
|
||||||
Thread.abort_on_exception = true
|
Thread.abort_on_exception = true
|
||||||
TrackCertificate
|
TrackCertificate
|
||||||
server_sockets = {
|
|
||||||
TCPServer.new(Postal.config.fast_server.bind_address, Postal.config.fast_server.ssl_port) => {:ssl => true},
|
bind_addresses = Postal.config.fast_server.bind_address
|
||||||
TCPServer.new(Postal.config.fast_server.bind_address, Postal.config.fast_server.port) => {:ssl => false},
|
bind_addresses = [bind_addresses] unless bind_addresses.is_a?(Array)
|
||||||
}
|
|
||||||
Postal.logger_for(:fast_server).info("Fast server started listening on HTTP (#{Postal.config.fast_server.bind_address}:#{Postal.config.fast_server.port})")
|
server_sockets = bind_addresses.each_with_object({}) do |bind_addr, sockets|
|
||||||
Postal.logger_for(:fast_server).info("Fast server started listening on HTTPS port (#{Postal.config.fast_server.bind_address}:#{Postal.config.fast_server.ssl_port})")
|
sockets[TCPServer.new(bind_addr, Postal.config.fast_server.port)] = {:ssl => false}
|
||||||
|
sockets[TCPServer.new(bind_addr, Postal.config.fast_server.ssl_port)] = {:ssl => true}
|
||||||
|
Postal.logger_for(:fast_server).info("Fast server started listening on HTTP (#{bind_addr}:#{Postal.config.fast_server.port})")
|
||||||
|
Postal.logger_for(:fast_server).info("Fast server started listening on HTTPS port (#{bind_addr}:#{Postal.config.fast_server.ssl_port})")
|
||||||
|
end
|
||||||
|
|
||||||
loop do
|
loop do
|
||||||
client = nil
|
client = nil
|
||||||
ios = select(server_sockets.keys, nil, nil, 1)
|
ios = select(server_sockets.keys, nil, nil, 1)
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم