Skip to content

Commit

Permalink
Bind the gRPC command server port only to localhost.
Browse files Browse the repository at this point in the history
Work towards #930.

--
MOS_MIGRATED_REVID=120205147
  • Loading branch information
lberki authored and damienmg committed Apr 19, 2016
1 parent b7e1004 commit 0e689d9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import com.google.protobuf.ByteString;

import io.grpc.Server;
import io.grpc.ServerBuilder;
import io.grpc.netty.NettyServerBuilder;
import io.grpc.stub.StreamObserver;

import java.io.IOException;
Expand Down Expand Up @@ -167,7 +167,7 @@ private static String generateCookie(SecureRandom random, int byteCount) {
@Override
public void serve() throws IOException {
Preconditions.checkState(!serving);
server = ServerBuilder.forPort(port)
server = NettyServerBuilder.forAddress(new InetSocketAddress("localhost", port))
.addService(CommandServerGrpc.bindService(this))
.build();

Expand Down

0 comments on commit 0e689d9

Please sign in to comment.