Ruby 3.4 リファレンスマニュアル

instance method WEBrick::HTTPRequest#port

port -> String[permalink][rdoc][edit]

サーバのポートを文字列で返します。