-
Notifications
You must be signed in to change notification settings - Fork 84
Description
Describe the bug
I'm running this on my laptop - trying to do a VNC tunnel on a remote Ubuntu device.
./localproxy -r us-east-1 -s 8000 -v 6 -t TOKEN_HERE
I am getting this from localproxy:
Handling tcp socket error for service id: VNC connection id: 1. error message: End of file
And, I'm getting this from aws-iot-device-client logs:
TcpForward::OnConnectionResult error_code=1047
To Reproduce
Steps to reproduce the behavior:
VNC is running on the remote Ubuntu device already.
Creating tunnel first...
aws iotsecuretunneling open-tunnel --cli-input-json file:///X/tunnel.json --region us-east-1
Running local proxy on my laptop...
./localproxy -r us-east-1 -s 8000 -v 6 -t TOKEN_HERE
Expected behavior
A working VNC tunnel.
Actual behavior
No VNC tunnel. :(
Logs
./localproxy -r us-east-1 -s 8000 -v 6 -t TOKEN_HERE
[2023-01-27T09:46:03.623285]{51191}[warning] Found access token supplied via CLI arg. Consider using environment variable AWSIOT_TUNNEL_ACCESS_TOKEN instead
[2023-01-27T09:46:03.623943]{51191}[debug] v2 local proxy starts with v1 local proxy format
[2023-01-27T09:46:03.624045]{51191}[debug] /Users/XX/Downloads/aws-iot-device-client/dependencies/aws-iot-securetunneling-localproxy/build/bin/config does not exist!
[2023-01-27T09:46:03.624062]{51191}[info] Starting proxy in source mode
[2023-01-27T09:46:03.624109]{51191}[trace] Setting up web socket...
[2023-01-27T09:46:03.654195]{51191}[trace] Calling control_callback with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:03.654423]{51191}[info] Attempting to establish web socket connection with endpoint wss://data.tunneling.iot.us-east-1.amazonaws.com:443
[2023-01-27T09:46:03.654433]{51191}[trace] Resolving proxy server host: data.tunneling.iot.us-east-1.amazonaws.com
[2023-01-27T09:46:04.770449]{51191}[debug] Resolved proxy server IP: 34.225.0.142
[2023-01-27T09:46:04.770936]{51191}[trace] Calling lowest_layer with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:04.826284]{51191}[debug] Connected successfully with proxy server
[2023-01-27T09:46:04.826315]{51191}[trace] Calling lowest_layer with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:04.826328]{51191}[trace] Calling lowest_layer with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:04.826337]{51191}[trace] Performing SSL handshake with proxy server
[2023-01-27T09:46:04.826346]{51191}[trace] Calling set_verify_mode with type: single_ssl_stream
[2023-01-27T09:46:04.826354]{51191}[trace] Calling set_verify_callback with type: single_ssl_stream
[2023-01-27T09:46:04.826371]{51191}[trace] Calling next_layer().async_handshake with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:04.947921]{51191}[debug] Successfully completed SSL handshake with proxy server
[2023-01-27T09:46:04.948092]{51191}[trace] Performing websocket handshake with proxy server
[2023-01-27T09:46:04.948145]{51191}[trace] Calling async_handshake with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:04.950210]{51191}[trace] Web socket ugprade request(*not entirely final):
GET /tunnel?local-proxy-mode=source HTTP/1.1
Host: data.tunneling.iot.us-east-1.amazonaws.com
Upgrade: websocket
Connection: upgrade
Sec-WebSocket-Key: SVLqp5coGNQRi+ZmPwOfzw==
Sec-WebSocket-Version: 13
Sec-WebSocket-Protocol: aws.iot.securetunneling-3.0
access-token: ***ACCESS_TOKEN_REMOVED***
User-Agent: localproxy Mac OS 64-bit/boost-1.79.0/openssl-3.0.0/protobuf-3.21.12
[2023-01-27T09:46:05.049432]{51191}[trace] Web socket upgrade response:
HTTP/1.1 101 Switching Protocols
Date: Fri, 27 Jan 2023 15:46:05 GMT
Content-Length: 0
Connection: upgrade
channel-id: 0eb09ffffe7028c1-00000859-00023a24-980ab6cb8f9aaa61-3246b4b7
upgrade: websocket
sec-websocket-accept: SsvcnZBAQzc/Hdwv8FpleBIoATc=
sec-websocket-protocol: aws.iot.securetunneling-3.0
[2023-01-27T09:46:05.049708]{51191}[trace] Calling binary with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:05.049738]{51191}[trace] Calling auto_fragment with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:05.049758]{51191}[info] Web socket session ID: 0eb09ffffe7028c1-00000859-00023a24-980ab6cb8f9aaa61-3246b4b7
[2023-01-27T09:46:05.049782]{51191}[debug] Web socket subprotocol selected: aws.iot.securetunneling-3.0
[2023-01-27T09:46:05.049804]{51191}[info] Successfully established websocket connection with proxy server: wss://data.tunneling.iot.us-east-1.amazonaws.com:443
[2023-01-27T09:46:05.049842]{51191}[debug] Seting up web socket pings for every 20000 milliseconds
[2023-01-27T09:46:05.049863]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:05.050200]{51191}[trace] Waiting for service ids...
[2023-01-27T09:46:05.050238]{51191}[trace] async_web_socket_read_loop_for_service_ids
[2023-01-27T09:46:05.050259]{51191}[debug] Scheduled next read:
[2023-01-27T09:46:05.050279]{51191}[trace] Calling async_read_some with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:05.052968]{51191}[trace] Processing control message
[2023-01-27T09:46:05.053017]{51191}[trace] Using global control message handler
[2023-01-27T09:46:05.053038]{51191}[debug] Extracting service Ids from control message 5
[2023-01-27T09:46:05.053062]{51191}[trace] Service id received:
[2023-01-27T09:46:05.053080]{51191}[trace] VNC
[2023-01-27T09:46:05.053099]{51191}[trace] Validating service ids configuration
[2023-01-27T09:46:05.053126]{51191}[info] Updated port mapping for v1 format:
[2023-01-27T09:46:05.053144]{51191}[info] VNC = 8000
[2023-01-27T09:46:05.053163]{51191}[trace] Setting up tcp sockets
[2023-01-27T09:46:05.053181]{51191}[trace] Clearing all ws data buffers
[2023-01-27T09:46:05.053199]{51191}[trace] Finished Clearing all ws data buffers
[2023-01-27T09:46:05.053217]{51191}[trace] Initializing tcp servers ...
[2023-01-27T09:46:05.053234]{51191}[trace] Setting up source tcp sockets
[2023-01-27T09:46:05.053339]{51191}[info] calling setup from loop
[2023-01-27T09:46:05.053367]{51191}[trace] Setting up tcp socket for service id: VNC
[2023-01-27T09:46:05.053410]{51191}[debug] Resolving bind address host: localhost
[2023-01-27T09:46:05.053449]{51191}[debug] Port to connect 8000
[2023-01-27T09:46:05.053485]{51191}[trace] return continue_reading true
[2023-01-27T09:46:05.053508]{51191}[debug] Starting web socket read loop continue reading...
[2023-01-27T09:46:05.053526]{51191}[trace] Calling async_read_some with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:05.054645]{51191}[debug] Resolved bind IP: 127.0.0.1
[2023-01-27T09:46:05.054842]{51191}[info] Listening for new connection on port 8000
[2023-01-27T09:46:05.103105]{51191}[trace] Pong reply latency: 54 ms
[2023-01-27T09:46:16.705453]{51191}[debug] socket port 8000
[2023-01-27T09:46:16.705600]{51191}[debug] endpoint mapping:
[2023-01-27T09:46:16.705614]{51191}[debug] VNC = 8000
[2023-01-27T09:46:16.705630]{51191}[info] creating tcp connection id 1
[2023-01-27T09:46:16.705657]{51191}[info] Accepted tcp connection on port 8000 from 127.0.0.1:62381
[2023-01-27T09:46:16.705684]{51191}[debug] Sending stream start, setting new stream ID to: 1, service id: VNC
[2023-01-27T09:46:16.705751]{51191}[trace] Sending messages over web socket for service id: VNC connection id: 1
[2023-01-27T09:46:16.705763]{51191}[trace] Current queue size: 0
[2023-01-27T09:46:16.705772]{51191}[trace] Put data 13 bytes into the web_socket_outgoing_message_queue for service id: VNC connection id: 1
[2023-01-27T09:46:16.705783]{51191}[trace] Getting tcp connection with id: 1
[2023-01-27T09:46:16.705793]{51191}[trace] num active connections for service id VNC: 1
[2023-01-27T09:46:16.705823]{51191}[trace] Calling async_write with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:16.709566]{51191}[trace] Sent 13 bytes over websocket for service id: VNC connection id: 1
[2023-01-27T09:46:16.709599]{51191}[trace] capturing after_send_message
[2023-01-27T09:46:16.709610]{51191}[trace] Setting up bi-directional data transfer for service id: VNC connection id: 1
[2023-01-27T09:46:16.709634]{51191}[trace] Getting tcp connection with id: 1
[2023-01-27T09:46:16.709643]{51191}[trace] num active connections for service id VNC: 1
[2023-01-27T09:46:16.709652]{51191}[trace] Clearing tcp connection buffers
[2023-01-27T09:46:16.709666]{51191}[debug] Starting web socket read loop while web socket is already reading. Ignoring...
[2023-01-27T09:46:16.709718]{51191}[trace] Begin tcp socket read loop for service id : VNC connection id : 1
[2023-01-27T09:46:16.709731]{51191}[trace] Getting tcp connection with id: 1
[2023-01-27T09:46:16.709740]{51191}[trace] num active connections for service id VNC: 1
[2023-01-27T09:46:16.709749]{51191}[trace] Initiating tcp socket read
[2023-01-27T09:46:16.709858]{51191}[trace] web_socket_outgoing_message_queue is empty, no more messages to send.
[2023-01-27T09:46:25.053361]{51191}[trace] Sent ping data: 1674834385053
[2023-01-27T09:46:25.053499]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:25.108217]{51191}[trace] Pong reply latency: 55 ms
[2023-01-27T09:46:45.054964]{51191}[trace] Sent ping data: 1674834405054
[2023-01-27T09:46:45.055114]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:46:45.111432]{51191}[trace] Pong reply latency: 57 ms
[2023-01-27T09:47:05.056718]{51191}[trace] Sent ping data: 1674834425056
[2023-01-27T09:47:05.056868]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:47:05.115184]{51191}[trace] Pong reply latency: 59 ms
[2023-01-27T09:47:25.058556]{51191}[trace] Sent ping data: 1674834445058
[2023-01-27T09:47:25.058758]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:47:25.115621]{51191}[trace] Pong reply latency: 57 ms
[2023-01-27T09:47:45.060577]{51191}[trace] Sent ping data: 1674834465060
[2023-01-27T09:47:45.060693]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:47:45.117544]{51191}[trace] Pong reply latency: 57 ms
[2023-01-27T09:48:05.062961]{51191}[trace] Sent ping data: 1674834485062
[2023-01-27T09:48:05.063130]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:48:05.117347]{51191}[trace] Pong reply latency: 55 ms
[2023-01-27T09:48:25.064799]{51191}[trace] Sent ping data: 1674834505064
[2023-01-27T09:48:25.065126]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:48:25.121384]{51191}[trace] Pong reply latency: 57 ms
[2023-01-27T09:48:45.066164]{51191}[trace] Sent ping data: 1674834525066
[2023-01-27T09:48:45.066316]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:48:45.381085]{51191}[trace] Pong reply latency: 315 ms
[2023-01-27T09:49:05.066725]{51191}[trace] Sent ping data: 1674834545066
[2023-01-27T09:49:05.066885]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:49:05.131174]{51191}[trace] Pong reply latency: 65 ms
[2023-01-27T09:49:25.068413]{51191}[trace] Sent ping data: 1674834565068
[2023-01-27T09:49:25.068568]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:49:25.124325]{51191}[trace] Pong reply latency: 56 ms
[2023-01-27T09:49:45.070074]{51191}[trace] Sent ping data: 1674834585070
[2023-01-27T09:49:45.070237]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:49:45.659112]{51191}[trace] Pong reply latency: 589 ms
[2023-01-27T09:50:05.073947]{51191}[trace] Sent ping data: 1674834605073
[2023-01-27T09:50:05.074068]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:50:05.127182]{51191}[trace] Pong reply latency: 54 ms
[2023-01-27T09:50:25.076024]{51191}[trace] Sent ping data: 1674834625075
[2023-01-27T09:50:25.076186]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:50:25.135193]{51191}[trace] Pong reply latency: 60 ms
[2023-01-27T09:50:45.078008]{51191}[trace] Sent ping data: 1674834645077
[2023-01-27T09:50:45.078182]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:50:45.133711]{51191}[trace] Pong reply latency: 56 ms
[2023-01-27T09:51:05.079519]{51191}[trace] Sent ping data: 1674834665079
[2023-01-27T09:51:05.079742]{51191}[trace] Calling async_ping with type: websocket_stream_single_ssl_type
[2023-01-27T09:51:05.135645]{51191}[trace] Pong reply latency: 56 ms
[2023-01-27T09:51:06.465979]{51191}[trace] Handling read from tcp socket for service id VNC connection id 1
[2023-01-27T09:51:06.466140]{51191}[trace] Getting tcp connection with id: 1
[2023-01-27T09:51:06.466343]{51191}[trace] num active connections for service id VNC: 1
[2023-01-27T09:51:06.466371]{51191}[trace] received error code: asio.misc:2
[2023-01-27T09:51:06.466975]{51191}[debug] Handling tcp socket error for service id: VNC connection id: 1. error message: End of file
[2023-01-27T09:51:06.467006]{51191}[trace] Getting tcp connection with id: 1
[2023-01-27T09:51:06.467027]{51191}[trace] num active connections for service id VNC: 1
[2023-01-27T09:51:06.467046]{51191}[info] Disconnected from: 127.0.0.1:62381
[2023-01-27T09:51:06.473420]{51191}[fatal] shutdown: Socket is not connected [system:57]
Environment (please complete the following information):
- OS: Ubuntu (remote), and source is MacOS laptop
- Version 18 (remote)
- Architecture: x86-64
- Localproxy commit: latest