feat!: doesn't hardcode host ip
This commit is contained in:
parent
cce730a57f
commit
b57633b89a
3 changed files with 7 additions and 13 deletions
|
@ -18,7 +18,8 @@
|
|||
"windows":{
|
||||
"obs_re": "OBS *",
|
||||
"propresenter_re": "ProPresenter - .*",
|
||||
"chrome_re": ".* - Google Chrome"
|
||||
"chrome_re": ".* - Google Chrome",
|
||||
"tcp_port": "8005"
|
||||
},
|
||||
"hotkeys":{
|
||||
"obs":{
|
||||
|
|
15
src/main.rs
15
src/main.rs
|
@ -10,24 +10,17 @@ use crate::modules::stream_states::state_update::StateUpdate;
|
|||
mod tests;
|
||||
mod modules;
|
||||
|
||||
#[cfg(target_os = "windows")]
|
||||
const SERVER_ADDRESS: &str = "10.0.0.114:5000";
|
||||
|
||||
#[cfg(release)]
|
||||
#[cfg(target_os = "windows")]
|
||||
const SERVER_ADDRESS: &str = "10.0.0.209:5000";
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
const SERVER_ADDRESS: &str = "10.0.0.168:5000";
|
||||
const SERVER_ADDRESS: &str = "0.0.0.0:";
|
||||
|
||||
fn main() {
|
||||
let settings_json = load_json();
|
||||
let hotkeys = Hotkeys::new(settings_json);
|
||||
let hotkeys = Hotkeys::new(settings_json.clone());
|
||||
|
||||
let (from_socket_tx, from_socket_rx) = unbounded::<String>();
|
||||
let hotkey_channel_tx = from_socket_tx.clone();
|
||||
|
||||
let mut socket = Socket::handle_connections(Socket::make_listener(SERVER_ADDRESS), from_socket_tx);
|
||||
println!("Opening on port: {}", settings_json["windows"]["tcp_port"]);
|
||||
let mut socket = Socket::handle_connections(Socket::make_listener((String::from(SERVER_ADDRESS) + &settings_json["windows"]["tcp_port"].to_string()).as_str()), from_socket_tx);
|
||||
|
||||
let (hotkey_close_flag_tx, hotkey_close_flag_rx) = sync_flag::new_syncflag(true);
|
||||
let control_c_called_flag_rx = setup_control_c(hotkey_close_flag_tx);
|
||||
|
|
|
@ -30,7 +30,7 @@ pub fn create_keyboard_hooks(channel_tx: crossbeam_channel::Sender<String>, clos
|
|||
tx_2.send(StateUpdate::ChangeSlide(SlideChange::NextHotkey).to_json().to_string()).unwrap();
|
||||
});
|
||||
|
||||
inputbot::handle_input_events(close_flag);
|
||||
inputbot::handle_input_events();
|
||||
}
|
||||
|
||||
#[cfg(feature = "no_hotkeys")]
|
||||
|
|
Loading…
Reference in a new issue