NAME

Egg::Plugin::Request::ServerPort - Server port is compelled by a set value.

SYNOPSIS

use Egg qw/ Request::ServerPort /;

__PACKAGE__->egg_startup(
  .......
  ...
  plugin_server_port => {
    http  => 80,
    https => 443,
    },
  );

# A present server port is acquired.
my $now_port= $e->request->server_port;

DESCRIPTION

It is a plug-in for $e->request->server_port to return the value of the setting to the compulsion commutation ticket.

For instance, when the proxy is set up in the front end, and Egg is operated by the back end, $e->request->server_port returns the port number of the back end.

Therefore, it becomes a problem with 'http://domain.name:[PORT]/' in $e->request->uri etc. because it is returned.

This plugin solves such a problem.

CONFIGURATION

The setting is 'plugin_server_port'.

http

Returned port number usually.

Default is '80'.

https

Port number returned when $e->secure is true.

Default is '443'.

SEE ALSO

Egg::Request, Egg::Release,

AUTHOR

Masatoshi Mizuno <lushe@cpan.org>

COPYRIGHT

Copyright (C) 2007 by Bee Flag, Corp. <http://egg.bomcity.com/>, All Rights Reserved.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.