我是这方面的新手,我不知道为什么我的应用程序只能在开放网络中工作和运行,什么时候在代理后面我有一个返回错误。我正在使用raspberry zero
, with raspbian Stretch
, usingazure-iot-sdk-python
和 proxysquid
我已经尝试过这些东西:
代理允许 HTTPS 连接,并且它所有的 PORT 都可用且没有任何限制和地址 *****。azure-devices.net 被放入白名单中
$ nano / etc / squid / whitelist
除此之外,我在操作系统中设置代理,raspbian Stretch,在
$ nano / etc / environment
以下配置:
导出 http_proxy = " http://192.168.2.254:3128/ "
导出 https_proxy = " https://192.168.2.254:3128/ "
导出 no_proxy = "本地主机,127.0.0.1"
而且还在
$ nano ~ / .bashrc
导出 http_proxy = http://192.168.2.254:3128
导出 https_proxy = https://192.168.2.254:3128
导出 no_proxy = 本地主机,127.0.0.1
和,
$ nano /etc/apt/apt.conf.d/90proxy
获取::http::代理“ http://192.168.2.254:3128/ ”;
获取::https::代理“ https://192.168.2.254:3128/ ”;
from iothub_client import IoTHubClient, IoTHubTransportProvider, IoTHubMessage
import time
CONNECTION_STRING = "HostName=******.azure-devices.net;DeviceId=***;SharedAccessKey=*********"
PROTOCOL = IoTHubTransportProvider.MQTT
def send_confirmation_callback(message, result, user_context):
print("Confirmation received for message with result = %s" % (result))
if __name__ == '__main__':
client = IoTHubClient(CONNECTION_STRING, PROTOCOL)
message = IoTHubMessage("test message")
client.send_event_async(message, send_confirmation_callback, None)
print("Message transmitted to IoT Hub")
while True:
time.sleep(1)
Error: File: /usr/sdk/src/c/c-utility/adapters/socketio_berkeley.c Func: lookup_address_and_initiate_socket_connection Line: 282 Failure: getaddrinfo failure -3.
Error: File: /usr/sdk/src/c/c-utility/adapters/socketio_berkeley.c Func: socketio_open Line: 765 lookup_address_and_connect_socket failed
Error: File: /usr/sdk/src/c/c-utility/adapters/tlsio_openssl.c Func: on_underlying_io_open_complete Line: 760 Invalid tlsio_state. Expected state is TLSIO_STATE_OPENING_UNDERLYING_IO.
Error: File: /usr/sdk/src/c/c-utility/adapters/tlsio_openssl.c Func: tlsio_openssl_open Line: 1258 Failed opening the underlying I / O.
Error: File: /usr/sdk/src/c/umqtt/src/mqtt_client.c Func: mqtt_client_connect Line: 1000 Error: io_open failed
Error: File: /usr/sdk/src/c/iothub_client/src/iothubtransport_mqtt_common.c Func: SendMqttConnectMsg Line: 2122 failure connecting