#๐Ÿ”’ end to end messageing system issue

118 messages ยท Page 1 of 1 (latest)

outer zealotBOT
#

@slender garden

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

vapid remnant
#

@slender garden please use our pastebin if you want to share code

#

we block that site because it's frequently used to share malware

slender garden
#

oh

rugged basin
#

!paste

outer zealotBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

slender garden
#

but its two files

vapid remnant
#

our pastebin supports multiple files

slender garden
#

didnt work said it was too long

#

past 2000 characters

vapid remnant
#

Share just the relevant parts, try to strip it down to just the minimum reproducable code

slender garden
#

did that work

vapid remnant
#

yup, so what specific error are you encountering and what have you tried so far?

slender garden
#

!paste
Traceback (most recent call last):
File "/Users/williamanderson/Desktop/endtoendclientcopy.py", line 91, in <module>
client = EncryptedMessagingClient(server_url, username, password)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/adapters.py", line 507, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='192.168.1.70', port=5000): Max retries exceeded with url: /register (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x10a194e90>, 'Connection to 192.168.1.70 timed out. (connect timeout=None)'))
williamanderson@Williams-MacBook-Air ~ %

outer zealotBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.pythondiscord.com/

After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.

slender garden
#

this is a error from my friends computer there is a server side and a client and his computer doesnt seem to be connecting to the server running on the raspberry pi

#

i can paste the error in a pastebin if necessary i had to cut some of it off

vapid remnant
#

I'm not the best at networking, but do you have the appropriate ports forwarded to allow external connections? Do you have the correct IP?

slender garden
#

i have the correct ip i think what do u mean appropriate ports forwarded to allow connections

#

im new too

#

haha

#

i do mostly ai work

#

never networking

#

i stay far away from it

vapid remnant
#

So, are the computer and pi on the same network?

slender garden
#

no my friends computer is out of the netwoek

#

the pi is on my home network

weary mural
#

you are going to need to configure your router to map a public port to your rpi on the port 5000

vapid remnant
slender garden
#

like this

#

but what do i put in to it

#

sorry i just have never done networking before

#

haha

ember whale
#

assuming that you run python3 endtoendclient.py http://router-public-ip:5000/

slender garden
#

do i need a application name

#

and what is the protocal

ember whale
#

if you want to get rid of the :5000 and just do http://router-public-ip/then do

ember whale
#

that's probably just so that you can identify the rule later

slender garden
#

so no 5000 in the orignal port?

#

section?

ember whale
#

protocol is what type of traffic is going to be going through the port

#

no idea what the schedule dropdown could be

slender garden
#

i think its always?

ember whale
ember whale
#

i don't have a verizon router - that's not a networking option

#

that's a verizon thing

slender garden
#

that ok

ember whale
ember whale
# slender garden that ok

seems reasonable to me, hit save and clients will be able to connect by accessing http://your.public.ip.address:5000/endpoint

#

if you wanna get rid of :5000 then just switch Original Port to 80 (but beware, you're going to get some spam-requests from bots)

slender garden
#

still not working

#

immq try orginal port being 80

#

but does that mean code needs to change too?

#

or just connection

ember whale
#

just the client

#

the args you're using to start the client

slender garden
#

i cant find it in client code

ember whale
#

it won't be 192.168.1.70 if the client is on a different network

slender garden
#

ohhhhhh what would it be

ember whale
#

192.168.x.y is a local area address that only works in the local area network

slender garden
#

what would be outside?

ember whale
#

if you want to communicate with a computer which is NOT on your local area network, you need to use it's wide area address

#

aka public ip

slender garden
#

how i find that i am clueless with all networking im sorry

ember whale
#

the easiest way to figure it out is to just go on the rpi and curl ipinfo.me

#

actually curl ifconfig.me

#

forgot the website

slender garden
#

its a long string not just 4 sections?

#

not structured like 0.0.0.0

ember whale
slender garden
#

yeea

ember whale
#

it's an IPv6 address

#

same thing

slender garden
#

how i get v4

#

eaier

#

easier

ember whale
#

well if you want a v4 address you'll have to purchase that upgrade from your ISP

#

or build a time machine and travel back to 40 years ago and beg some guys at stanford to PLEASE add a few extra bytes to ipv4

#

otherwise, just use your ipv6 address

#

or buy a domain name to point to that ipv6 address

#

or rent one from a provider like AWS, although I don't think they can hook that up to your home router

#

theoretically you could proxy traffic through one of their machines with ipv4 access

#

all of this is more expensive and more complicated than just using your v6 address

#

which btw, changes every few weeks (unless you purchase a static IP from your ISP, which would likely have been a v4 address, so I doubt that) - so don't plan on hosting this service from your home indefinitely

slender garden
#

t__
self.register(username, password)
File "/Users/williamanderson/Desktop/endtoendclientcopy.py", line 33, in register
response = requests.post(f"{self.server_url}/register", json={'username': username, 'password': password})
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/sessions.py", line 575, in request
prep = self.prepare_request(req)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/sessions.py", line 486, in prepare_request
p.prepare(
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/models.py", line 368, in prepare
self.prepare_url(url, params)
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/models.py", line 436, in prepare_url
raise InvalidURL(*e.args)
requests.exceptions.InvalidURL: Failed to parse: http://2600:4040:a923:9800:825f:bc28:66c8:6f2e:5000/register
williamanderson@Williams-MacBook-Air ~ %
it has new error

ember whale
#

it's http://[2600:4040:a923:9800:825f:bc28:66c8:6f2e]:5000/

#

with brackets []

#

otherwise it couldn't really parse the port :5000 separately

slender garden
#

http://[2600:4040:a923:9800:825f:bc28:66c8:6f2e]:5000/

#

williamanderson@Williams-MacBook-Air ~ % python3 /Users/williamanderson/Desktop/endtoendclientcopy.py http://2600:4040:a923:9800:825f:bc28:66c8:6f2e:5000 user5 passwordforuser5 edit this and show me cause it didnt work that one time

#

with the brackets

ember whale
#

can you show the new traceback, after adding brackets

slender garden
#

zsh: no matches found: http://[2600:4040:a923:9800:825f:bc28:66c8:6f2e]:5000/

ember whale
#

you still have to have the python3part

slender garden
#

williamanderson@Williams-MacBook-Air ~ % python3 /Users/williamanderson/Desktop/endtoendclientcopy.py http://[2600:4040:a923:9800:825f:bc28:66c8:6f2e]:5000/ user5 passwordforuser5

#

i do

ember whale
#

yeah

slender garden
#

Last login: Wed Feb 28 00:43:02 on ttys000
williamanderson@Williams-MacBook-Air ~ % python3 /Users/williamanderson/Desktop/endtoendclientcopy.py http://[2600:4040:a923:9800:825f:bc28:66c8:6f2e]:5000/ user5 passwordforuser5
zsh: no matches found: http://[2600:4040:a923:9800:825f:bc28:66c8:6f2e]:5000/
williamanderson@Williams-MacBook-Air ~ %

#

i confused af

ember whale
#

try putting it in quotes

slender garden
#

show

ember whale
#

python3 /Users/williamanderson/Desktop/endtoendclientcopy.py "http://[2600:4040:a923:9800:825f:bc28:66c8:6f2e]:5000/" user5 passwordforuser5

slender garden
#

nope same error

#

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/api.py", line 115, in post
return request("post", url, data=data, json=json, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/api.py", line 59, in request
return session.request(method=method, url=url, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/sessions.py", line 589, in request
resp = self.send(prep, **send_kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/sessions.py", line 703, in send
r = adapter.send(request, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/adapters.py", line 507, in send
raise ConnectTimeout(e, request=request)
requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='2600:4040:a923:9800:825f:bc28:66c8:6f2e', port=5000): Max retries exceeded with url: //register (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x105281010>, 'Connection to 2600:4040:a923:9800:825f:bc28:66c8:6f2e timed out. (connect timeout=None)'))

ember whale
#

can you ping the address?

slender garden
#

which the v6

ember whale
#

yes

slender garden
#

no unkown host

#

im confused af

#

Last login: Wed Feb 28 00:59:38 on ttys000
williamanderson@Williams-MacBook-Air ~ % ping 2600:4040:a923:9800:825f:bc28:66c8:6f2e
ping: cannot resolve 2600:4040:a923:9800:825f:bc28:66c8:6f2e: Unknown host
williamanderson@Williams-MacBook-Air ~ %

#

@ember whale

#

doesnt make much sense

outer zealotBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.