# See the License for the specific language governing permissions and
# limitations under the License.
-oclip.grpc_server_port=50051
\ No newline at end of file
+oclip.grpc_server_port=50051
+oclip.grpc_server_host=localhost
\ No newline at end of file
private static final String CONF_FILE = "oclip-grpc-server.properties";
private static final String CONF_SERVER_PORT = "oclip.grpc_server_port";
+ private static final String CONF_SERVER_HOST = "oclip.grpc_server_host";
static {
OnapCommandConfig.addProperties(CONF_FILE);
private void start(String portArg) throws IOException {
/* The port on which the server should run */
int port = Integer.parseInt(portArg == null ? OnapCommandConfig.getPropertyValue(CONF_SERVER_PORT) : portArg);
+ String host = OnapCommandConfig.getPropertyValue(CONF_SERVER_HOST);
+ if (host == null) {
+ host = InetAddress.getLocalHost().getHostAddress().trim();
+ }
server = ServerBuilder.forPort(port)
.addService(new OpenInterfaceGrpcImpl())
.build()
logger.info("Server started, listening on " + port);
try {
- OnapCommandRegistrar.getRegistrar().setHost(InetAddress.getLocalHost().getHostAddress().trim());
+ OnapCommandRegistrar.getRegistrar().setHost(host);
OnapCommandRegistrar.getRegistrar().setPort(port);
} catch (OnapCommandException e) {
//Never Occurs
# See the License for the specific language governing permissions and
# limitations under the License.
-oclip.grpc_server_port=50051
\ No newline at end of file
+oclip.grpc_server_port=50051
+oclip.grpc_server_host=localhost
\ No newline at end of file