mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-04 12:53:05 +00:00
* Add a command `forwardPort' to forward a TCP port on the host to a
TCP port on the guest. Useful during testing (e.g. to access a web server in the guest through a web browser on the host). svn path=/nixos/trunk/; revision=26987
This commit is contained in:
parent
043159ff25
commit
0f544f1ea8
@ -519,4 +519,14 @@ sub sleep {
|
||||
}
|
||||
|
||||
|
||||
# Forward a TCP port on the host to a TCP port on the guest. Useful
|
||||
# during interactive testing.
|
||||
sub forwardPort {
|
||||
my ($self, $hostPort, $guestPort) = @_;
|
||||
$hostPort = 8080 unless defined $hostPort;
|
||||
$guestPort = 80 unless defined $guestPort;
|
||||
$self->sendMonitorCommand("hostfwd_add tcp::$hostPort-:$guestPort");
|
||||
}
|
||||
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user