gRPC/REST TCP sockets cannot be bound to a specific host
@bharatjetti ci sta già lavorando.
Dal 24/3/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
Feature Request
Describe the problem the feature is intended to solve
The hostname 0.0.0.0 is hardcoded in the source code (with a comment that mistakenly claims that this results in listening on localhost):
I would like to be able to have the gRPC & REST APIs actually listen on localhost/127.0.0.1 so that the APIs are not exposed to the outside.
I'm aware of the option to create a UNIX socket instead using --grpc_socket_path, which I suppose I could proxy to a TCP socket that does listen on localhost. However, there's no such option for the REST API. The only option is to disable it completely by setting --rest_api_port=0.
Describe the solution
I would like there to be new command-line flags to set a hostname for the gRPC & REST APIs to listen on. The existing --port and --rest_api_port arguments could even be extended to accept a string like 127.0.0.1:8500.
Describe alternatives you've considered
The flag --grpc_socket_path is an alternative for the gRPC API, but there is no alternative for the REST API.
Additional context
I want to use this for network security purposes to not expose TensorFlow Serving more than it needs to be.
Temporary workaround
One way to temporarily solve this problem without having to fork TFS is to override the bind call using LD_PRELOAD, for example by using this snippet. You can then have TensorFlow Serving listen on localhost by running it like this:
BIND_ADDR="127.0.0.1" LD_PRELOAD=/bind_override/bind.so tensorflow_model_server --port=8500 --rest_api_port=8501 --model_name=model --model_base_path=/models/model
The log messages will continue to say that TFS is listening on 0.0.0.0, but netstat shows that it will be listening on localhost instead:
$ netstat -tulpn
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 127.0.0.1:8500 0.0.0.0:* LISTEN 11/tensorflow_model
tcp 0 0 127.0.0.1:8501 0.0.0.0:* LISTEN 11/tensorflow_model
- Lingua principale
- C++
- Stelle
- 6.4k
- Fork
- 2.2k
- Merge medio
- 7m
- PR unite (30g)
- 1
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di tensorflow/serving
-
gpg key expiredForse già presa @jeelania10 l’ha presa 13 giorni fa. Apertabug stat:awaiting response
Difficoltà 4/5 3-5 giorni Idoneità per principianti 38/100
tensorflow/serving#4150 · 2 commenti · 1 assegnatario ·
-
Vulnerability in Libgcrypt CVE-2026-41989Forse di nuovo libera @jeelania10 l’ha presa 54 giorni fa e non c’è nessuna pull request aperta. Apertastat:awaiting tensorflower type:support
tensorflow/serving#4139 · 1 commento · 1 assegnatario ·
-
**CVE-2025-0649** - I think this issue still exists in version 2.19.0 - At least my lab suggests it is.Forse di nuovo libera @jeelania10 l’ha presa 54 giorni fa e non c’è nessuna pull request aperta. Apertastat:contributions welcome type:bug
tensorflow/serving#4116 · 1 commento · 1 assegnatario ·
-
Error building TF Serving from sourceForse già presa @bharatjetti l’ha presa 316 giorni fa. Apertastat:contributions welcome type:build/install
tensorflow/serving#4108 · 8 commenti · 1 assegnatario ·
-
[Docs] Broken LinksForse di nuovo libera @jeelania10 l’ha presa 63 giorni fa e non c’è nessuna pull request aperta. Apertastat:contributions welcome type:docs
tensorflow/serving#2255 · 2 commenti · 1 assegnatario ·
Tutte le issue di tensorflow/serving
Issue simili
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
iOS: hidden scale bar invalidates its intrinsic content size on every layout pass of MLNMapViewAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
maplibre/maplibre-native#4723 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
HarbourMasters/Shipwright#7320 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Make Catch2 optional when `RDK_BUILD_CPP_TESTS=OFF`Forse già presa @pechersky l’ha presa oggi. Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 2 giorni