mirror of
https://github.com/webmin/webmin.git
synced 2026-03-20 08:40:24 +00:00
Merge branch 'master' of github.com:webmin/webmin
This commit is contained in:
@@ -64,14 +64,6 @@ else {
|
||||
$miniserv{'bind'} = $first->[0];
|
||||
}
|
||||
$miniserv{'sockets'} = join(" ", map { "$_->[0]:$_->[1]" } @sockets);
|
||||
# WebSocket bind address
|
||||
if ($in{'websocket_bind_def'}) {
|
||||
delete($miniserv{'websocket_bind'});
|
||||
}
|
||||
else {
|
||||
$miniserv{'websocket_bind'} = $in{'websocket_bind'};
|
||||
}
|
||||
# Websocket base port
|
||||
if ($in{'websocket_base_port_def'}) {
|
||||
delete($miniserv{'websocket_base_port'});
|
||||
}
|
||||
|
||||
@@ -46,14 +46,6 @@ if (&foreign_check("firewall") || &foreign_check("firewalld")) {
|
||||
}
|
||||
print &ui_table_row($text{'bind_sockets'}, $stable);
|
||||
|
||||
# WebSocket default bind address
|
||||
print &ui_table_row($text{'bind_websocaddr'},
|
||||
&ui_radio("websocket_bind_def",
|
||||
$miniserv{"websocket_bind"} ? 0 : 1,
|
||||
[ [ 1, $text{'bind_websocaddr_localhost'} ],
|
||||
[ 0, &ui_textbox("websocket_bind",
|
||||
$miniserv{"websocket_bind"}, 15) ] ]));
|
||||
|
||||
# WebSocket based port
|
||||
print &ui_table_row($text{'bind_websocport'},
|
||||
&ui_radio("websocket_base_port_def",
|
||||
|
||||
@@ -84,14 +84,6 @@ else {
|
||||
$miniserv{'bind'} = $first->[0];
|
||||
}
|
||||
$miniserv{'sockets'} = join(" ", map { "$_->[0]:$_->[1]" } @sockets);
|
||||
# WebSocket bind address
|
||||
if ($in{'websocket_bind_def'}) {
|
||||
delete($miniserv{'websocket_bind'});
|
||||
}
|
||||
else {
|
||||
$miniserv{'websocket_bind'} = $in{'websocket_bind'};
|
||||
}
|
||||
# Websocket base port
|
||||
if ($in{'websocket_base_port_def'}) {
|
||||
delete($miniserv{'websocket_base_port'});
|
||||
}
|
||||
|
||||
@@ -43,14 +43,6 @@ if (&foreign_check("firewall") || &foreign_check("firewalld")) {
|
||||
}
|
||||
print &ui_table_row($text{'bind_sockets'}, $stable);
|
||||
|
||||
# WebSocket default bind address
|
||||
print &ui_table_row($text{'bind_websocaddr'},
|
||||
&ui_radio("websocket_bind_def",
|
||||
$miniserv{"websocket_bind"} ? 0 : 1,
|
||||
[ [ 1, $text{'bind_websocaddr_localhost'} ],
|
||||
[ 0, &ui_textbox("websocket_bind",
|
||||
$miniserv{"websocket_bind"}, 15) ] ]));
|
||||
|
||||
# WebSocket based port
|
||||
print &ui_table_row($text{'bind_websocport'},
|
||||
&ui_radio("websocket_base_port_def",
|
||||
|
||||
@@ -49,8 +49,6 @@ bind_sport0=Same as first
|
||||
bind_sport1=Specific port ..
|
||||
bind_listen=Listen for broadcasts on UDP port
|
||||
bind_none=Don't listen
|
||||
bind_websocaddr=WebSocket bind address or hostname
|
||||
bind_websocaddr_localhost=Localhost (127.0.0.1)
|
||||
bind_websocport=WebSockets connection base port number
|
||||
bind_websocport_none=Default (555)
|
||||
bind_websoc_host=Hostname for WebSocket connections
|
||||
|
||||
@@ -104,19 +104,16 @@ $SIG{'ALRM'} = sub {
|
||||
die "timeout waiting for connection";
|
||||
};
|
||||
alarm(60);
|
||||
my %miniserv;
|
||||
&get_miniserv_config(\%miniserv);
|
||||
my $host = $miniserv{'websocket_bind'} || '127.0.0.1';
|
||||
&error_stderr("Listening on port $host:$port");
|
||||
&error_stderr("Listening on port $port");
|
||||
my ($wsconn, $shellbuf);
|
||||
my $server_socket = IO::Socket::INET->new(
|
||||
Listen => 5,
|
||||
LocalAddr => $host,
|
||||
LocalAddr => '127.0.0.1',
|
||||
LocalPort => $port,
|
||||
Proto => 'tcp',
|
||||
ReuseAddr => 1,
|
||||
);
|
||||
$server_socket || die "Failed to listen on port $host:$port";
|
||||
$server_socket || die "failed to listen on port $port";
|
||||
Net::WebSocket::Server->new(
|
||||
listen => $server_socket,
|
||||
on_connect => sub {
|
||||
|
||||
Reference in New Issue
Block a user