File tree Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Expand file tree Collapse file tree 1 file changed +6
-13
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
set -e
3
3
4
- # Start socat in the background to forward external connections
5
- socat TCP-LISTEN:8123,fork,reuseaddr,bind=0.0.0.0 TCP:127.0.0.1:8124 &
6
- SOCAT_PID=$!
7
-
8
- # Start emulator on internal port with gRPC binding
9
- /emulator -host 0.0.0.0 -port 8124 -grpc_port 8124 -grpc_host 0.0.0.0 &
4
+ # Start emulator binding to all interfaces
5
+ /emulator -host 0.0.0.0 -port 8123 -grpc_port 8123 &
10
6
EMULATOR_PID=$!
11
7
12
8
# Function to cleanup processes
13
9
cleanup () {
14
- kill $SOCAT_PID $ EMULATOR_PID 2> /dev/null || true
10
+ kill $EMULATOR_PID 2> /dev/null || true
15
11
}
16
12
17
13
# Set up trap
18
14
trap cleanup EXIT
19
15
20
16
# Wait for emulator to be ready
21
17
for i in $( seq 1 30) ; do
22
- if curl -s http://127.0.0.1:8124/v1/projects/test-project/locations/us-central1/queues > /dev/null; then
23
- echo " Emulator is ready on internal port!"
24
- if curl -s http://localhost:8123/v1/projects/test-project/locations/us-central1/queues > /dev/null; then
25
- echo " Emulator is accessible on external port!"
26
- break
27
- fi
18
+ if curl -s http://127.0.0.1:8123/v1/projects/test-project/locations/us-central1/queues > /dev/null; then
19
+ echo " Emulator is ready!"
20
+ break
28
21
fi
29
22
echo " Waiting for emulator... attempt $i "
30
23
sleep 1
You can’t perform that action at this time.
0 commit comments