diff --git a/src/main.cpp b/src/main.cpp index 175b12146..6c0cbc63a 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -462,11 +462,12 @@ static void copy_sv_to_c_buf(char (&dest)[N], std::string_view sv){ if(key == "help"){ col() << "Usage:\n" << - "\tuv " << TBOLD("-Nholepunch:room=:(server= | coord_srv=:stun_srv=)[:client_name=] \n") << + "\tuv " << TBOLD("-Nholepunch:room=:(server= | coord_srv=:stun_srv=)[:client_name=][:bind_ip=] \n") << "\twhere\n" "\t\t" << TBOLD("server") << " - used if both stun & coord server are on the same host on standard ports (3478, 12558)\n" "\t\t" << TBOLD("room") << " - name of room to join\n" "\t\t" << TBOLD("client_name") << " - name to identify as to the coord server, if not specified hostname is used\n" + "\t\t" << TBOLD("bind_ip") << " - local ip to bind to\n" "\n"; return false; } @@ -507,6 +508,8 @@ static void copy_sv_to_c_buf(char (&dest)[N], std::string_view sv){ copy_sv_to_c_buf(punch_c->room_name, val); } else if(key == "client_name"){ copy_sv_to_c_buf(punch_c->client_name, val); + } else if(key == "bind_ip"){ + copy_sv_to_c_buf(punch_c->bind_addr, val); } } diff --git a/src/utils/udp_holepunch.h b/src/utils/udp_holepunch.h index 905a2e3f6..dfffb23f4 100644 --- a/src/utils/udp_holepunch.h +++ b/src/utils/udp_holepunch.h @@ -60,7 +60,7 @@ struct Holepunch_config{ char *host_addr; size_t host_addr_len; - const char *bind_addr; + char bind_addr[64]; char coord_srv_addr[512]; int coord_srv_port;