I was trying to curl a tcp server using pycurl
class Detector():
def __init__(self, api_addr="tcp://localhost:8000"):
self.c = pycurl.Curl()
self.c.setopt(self.c.URL, api_addr)
def close_connection(self):
self.c.close()
def img_encode(self, img):
_, img_encoded = cv2.imencode('.jpg', img)
return img_encoded.tostring()
def detect(self, img):
encoded_msg = self.img_encode(img)
self.c.setopt(self.c.POSTFIELDS, encoded_msg)
return self.c.perform()
But it reports that pycurl.error: (1, 'Protocol "tcp" not supported or disabled in libcurl')
Is there any solution or it's not proper to curl a tcp server?