Open SuperCipher opened 7 years ago
You are actually not receiving any extra characters; the response is fine. What you are seeing is a singleton tuple with a unicode string inside, what the client is packaging the string 'copy'
as. To get the string you want, simply do str(args[0])
instead of args
in your callback.
receive extra character when using .on listening method
client side (python)
python 2.7 OSX
what receive from the client-end (received the unexpected)
expect to receive
copy
actual recieve(u'copy',)
server side code
"socket.io": "^1.7.3" nodeJs 8.6.0 OSX
what recieve from the server-end (recieved as expected)
aaa
If I change the code in client side (python) from
verify=False to verify='cert.pem'
I got an errorERROR:urllib3.connection:Certificate did not match expected hostname: localhost. Certificate: {'notBefore': u'Aug 29 09:08:30 2017 GMT', 'serialNumber': u'9A6416AB3B2A6919', 'notAfter': 'Aug 29 09:08:30 2018 GMT', 'version': 3L, 'subject': ((('countryName', u'TH'),), (('stateOrProvinceName', u'xxx'),), (('localityName', u'xxx'),), (('organizationName', u'Fps moonshot Ltd'),), (('organizationalUnitName', u'Fps developer'),), (('commonName', u'xxx'),), (('emailAddress', u'email@hotmail.com'),)), 'issuer': ((('countryName', u'TH'),), (('stateOrProvinceName', u'xxx'),), (('localityName', u'xxx'),), (('organizationName', u'Fps moonshot Ltd'),), (('organizationalUnitName', u'Fps developer'),), (('commonName', u'xxx'),), (('emailAddress', u'email@hotmail.com'),))} WARNING:socketIO-client-2:localhost:8080/socket.io [waiting for connection] HTTPSConnectionPool(host='localhost', port=8080): Max retries exceeded with url: /socket.io/?EIO=3&transport=polling&t=1504204491104-0 (Caused by SSLError(CertificateError("hostname 'localhost' doesn't match u'xxx'",),))