summaryrefslogtreecommitdiff
path: root/examples/rpc/rpc-server.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/rpc/rpc-server.cpp')
-rw-r--r--examples/rpc/rpc-server.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/examples/rpc/rpc-server.cpp b/examples/rpc/rpc-server.cpp
index 7c15d2aa..6342e648 100644
--- a/examples/rpc/rpc-server.cpp
+++ b/examples/rpc/rpc-server.cpp
@@ -16,7 +16,7 @@
#include <stdio.h>
struct rpc_server_params {
- std::string host = "0.0.0.0";
+ std::string host = "127.0.0.1";
int port = 50052;
size_t backend_mem = 0;
};
@@ -114,6 +114,17 @@ int main(int argc, char * argv[]) {
fprintf(stderr, "Invalid parameters\n");
return 1;
}
+
+ if (params.host != "127.0.0.1") {
+ fprintf(stderr, "\n");
+ fprintf(stderr, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ fprintf(stderr, "WARNING: Host ('%s') is != '127.0.0.1'\n", params.host.c_str());
+ fprintf(stderr, " Never expose the RPC server to an open network!\n");
+ fprintf(stderr, " This is an experimental feature and is not secure!\n");
+ fprintf(stderr, "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ fprintf(stderr, "\n");
+ }
+
ggml_backend_t backend = create_backend();
if (!backend) {
fprintf(stderr, "Failed to create backend\n");