#networks
1 messages · Page 29 of 1
ok will do
also dont run both scripts in IDLE
that wont work
to make it create 2 seperate processes
Ok I have been testing them on my laptop and desktop, but I guess since the client is going through the router it doesnt matter lol, will do give me one second
you can test on the same computer lmao
yeah I just thought of that lol its been a long couple of days ha, both scripts seem to hang, but I also changed "new_socket" to "sock" in the server I think thats what you meant, but yeah no prints
yes I did
You are good it seems to be a weird problem, do you know if there is a way to see if a firewall is blocking it by any chance?
i dont know sorry, you could download wireshark and see exactly what the packets are doing but its a guess
that is an interesting idea, I'll look into it, thanks for your help!
anyone knowledgeable with Apache Websocket reverse proxy? ( I am trying to get socket IO on a flask application to work but i am failing every time )
I have Flask + NGINX configuration 
hum... i've never done NGINX before
I don't really want to switch solutions just for this minor thing. So perhaps if you can just showcase your config file, maybe i'll take it from there
What library are you using to expose Flask application?
Liberary?
I'm exposing it via Apache reverse proxy, no?
but the ws connection keeps on disconnecting
https://flask.palletsprojects.com/en/1.1.x/deploying/fastcgi/ I am using it as far as I remember
However I am on different computer
I will check it later, ok?
Sure
what was wrong?
was it a closed connection like someone said :)
one of my variable was global so every client's thread tried to catch ALL the messages
so it crapped out
lol
now im sad cuz i wasted a day
lmao
i always get stuck on stupid crep like this.
i once tried to fix some code that didn't work for 3 HOURS,
i later found out that i forgot a : at the end of a while loop and i wasted 3 hours for nothing
thats what happens when you dont take time to read tracebacks
Hello everybody !
I made this lib : https://github.com/kstzl/UrsinaNetworking
Originally writen to the Ursina Engine but it work for every type or project 😉
Its a "real time, bi directionnal, event based" socket communication
have fun 😉
very nice
thank you 🙂
surely you got a syntax error pointing you to the line it was on?
damn right 😂
does every language do the tracebback thingy or just python?
your ide should have picked up on it before it ran
even IDLE has that feature lmao
lmao nah mate i used nano
now i use micro
which doesnt have that feature ether
afaik
you use a terminal ide 😂
idk
its easier to access/use and my pc takes ages to load anything. although i do have subline installed, i dont use it much
Here is how I run Flask
import ssl
from typing import NoReturn
from flask import Flask
from flup.server.fcgi import WSGIServer
def run(http: Flask, certificate: str, key: str) -> NoReturn:
ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
ssl_context.verify_mode = ssl.CERT_REQUIRED
ssl_context.load_verify_locations(certificate)
if certificate == key:
ssl_context.load_cert_chain(certificate)
else:
ssl_context.load_cert_chain(certificate, key)
http.run(host, port, ssl_context=ssl_context)
Here is a template for Docker NGINX
upstream endpoint{
server ${ENDPOINT_HOSTNAME}:${ENDPOINT_PORT};
}
server {
listen ${NGINX_PORT};
server_name localhost;
location / {
try_files $uri @endpoint;
}
location @manager {
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_NAME "";
fastcgi_pass endpoint;
}
}
server {
listen ${SOCKETIO_PORT} ssl;
server_name localhost;
ssl_protocols TLSv1.1 TLSv1.2;
ssl_certificate /etc/ssl/certs/ca.pem;
ssl_certificate_key /etc/ssl/certs/ca.pem;
ssl_client_certificate /etc/ssl/certs/ca.pem;
ssl_verify_client on;
location /socket.io/ {
try_files $uri @endpoint;
}
location @manager {
include fastcgi_params;
fastcgi_param PATH_INFO $fastcgi_script_name;
fastcgi_param SCRIPT_NAME "";
fastcgi_param SSL_CLIENT_CERT $ssl_client_raw_cert;
fastcgi_pass endpoint;
}
}
You have separation between /socket.io and other pages (you can host on different ports like me). However I am not master of NGINX config and people from #web-development may have better tips 
Thank you for this
Your welcome!
i forwarded a port and i have no idea to what ip i should bind my socket to.
nnvm.... stack says to put it on 0.0.0.0 or my internal one
If you bind 0.0.0.0 then connection is allowed to anyone
no, socket.bind()
Hey
yeah, he means if you do: socket.bind(("0.0.0.0", Port)) then it would allow connections from anywhere
which is probably what you want
Yeah. right! 👍
hey, I'm trying to figure out how to connect to the SSH server of a juniper switch and to then hop over to other device/devices. But when I do:
from netmiko import ConnectHandler
hop_switch = ConnectHandler(
device_type='juniper',
host='hallo.com',
username=username,
password=password)
hop_switch.send_command('ssh howareyou.com')
output = hop_switch.find_prompt()
print(output)
The thing though, juniper first wants you to accept the key which looks as follows: "Are you sure you want to continue connecting (yes/no)? and then it prompts you with "password:"
The "send_command" doesn't work. Does anyone know how to solve this?
you need to put the password into the initial ssh command itself
or generate a key and just use that
So I write the password in here "hop_switch.send_command('ssh howareyou.com')"
no i realise im wrong here, its much better to make a key
then you can authenticate with that
I don't see how I could generate the key, sadly enough I don't know too much about IKE and so forth
are you running windows 10 or what?
Yes
So this key will then, authenticate me through the RADIUS/TACACS+ server? 
Also if I swap hop_switch.send_command('ssh howareyou.com') to hop_switch.write_channel('ssh howareyou.com') I do get a prompt back asking for "Password:"
i dont know the difference between send-command and write-channel sorry
I've figured it out, partly!
I am trying to get a endpoint of a app but when i try to get the request using fiddler i cannot do the thing on the app (changing a name).
(timeout error)
Hello how can I send a public key , private key and username through a request in python
Like this
curl -u username --key "privatekey.pem" --cert "cert.cer" --cert-type PEM
oh lol
lmao
i got a question can i close connection for a specified ip?
you can close a socket
wait so i can do client.close() ?
i just have a lot of clients in a list and i want to be able to close connection for each one... like socket.close("112.123.135.12")
@prisma cobalt
is the list of ip's or the actual client sockets?
if its sockets then do:
list[index].close()
list.pop(index)
ah. i see. thank you!
.topic
Suggest more topics here!
@prisma cobalt hey remember me? The router less guy? You were gonna walk me through setting up aws to run a python socket server script, I got into some stuff, now I'm free please ping me when online lmao
ive got a few things i need to do so give me an hour if you can, while im gone it would be good if you made an aws account (free tier i assume)
i cant call but i think i have enough time to do a walk through now
lmao I don't mean VC by call lmao, just ping
no lol
Lemme do that real quick
But I have some things to ask before moving
Will I be able to update the running script, like versions
yeah pretty easily via ssh'ing into the terminal
lol ok
Which one do you think is better/simpler, aws or heroku?
ive never really used heroku and with my guide i think youll find aws easier
lol i mean, dont get your hopes up to high. i set mine up a few weeks ago
but it took ages trying to figure out how ot do it
so hopefully i can simply tell you to save some time
Yeah
have you made an account?
Bruh it's asking for banking info
yeah its annoying and it might charge you a penny or something to confirm but if you get the free tier they dont charge you
Lmao
Nice, go to your dashboard
yeah
Send a screenshot, lol I forgot the exact layout
as the root user right?
Yeah
this is what i'm seeing
Launch a virtual machine
yeah
Then send a screenshot lmao
gotcha
Jesus that’s a lot of tabs
Yes this is good
lmao
Go down and select Ubuntu 20.x
yeah
It doesn’t matter what x is since there’s only one option with it
Then select it
Then select free tier
Yep
then launch ig
Yeah
Yh
View instances
Okay you want to connect to it so go to connect (top left)
Press the copy sign under bullet point 4
yeah
Okay once your in the same directory as the key
Click on the search bar in file explorer and type cmd
Okay send the line that you copied here
Is that it?
yeah
It should begin with ssh
Yeah
lmao
Okay this is the command you should paste into the cmd terminal:
of the terminal?
Good
sweet
Okay decide what port you want traffic to connect on
the same port the server script uses
Btw what you’ve done is set up a server and transfer the script over to it
Which is?
which is?
What port
yeah lol
yess
Hang on I’m loggin in to show you
yeah
click there
output
tcp
output
in it
yess deleted lmao
what after this?
yupp
yeah i clicked, but it gave me the warning
have you created the rule?
instead of editing the ssh rule i meant to add a new rule, my bad
lmao
i clicked on save rule, but there's some warning there which prevented stuff form happening ig
ye
ah you didnt put in the proper port
save?
now we good
okay click actions then reboot
reboot what?
since the changes need to take effect
my pc?
lmao my bad
yeah
remember that ssh command you copied?
yeah
paste exactly that into the cmd terminal you created before
the same command again?
yeah the ssh..... one
yeah
send a screenshot
we are nearly done btw
also how familiar are you with linux terminal?
pretty good
somewhere between noob and intermediate
have you sshed in?
yeah probably
yeah ssh'd into it lmao
feels like a pro hacker to ssh into something for the first time in my life lmao
does python come preinstalled in here?
yeah which is nice
so we basically done?
nearly
oh
send a pic of the ssh'd into it
good, you see that your script is there
sweet
yeaah
well at least for as long as the server is up
where can i find the ip to update?
in the client file
yeah i was gonna guess that one too lmao
Hey @trim moth!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
oh
lol
send me the link to it
have you started it
yeah
lol
lol
you can only recieve message when you send a message
heh?
yeah
i just sent a message, still dont send anything
yeah
im guessing you cant see what i just sent
yeah, nothing after this is a test
oh hang on
lmao
i just sent something else
yeah i can see that reply in discord message
hmm weird
lmso
lol
send something
yeah
say when you have
i just sent something
okay heres my situation: nothings come up
i see
somethings wrong with the threading stuff
lmao
the messages sent by me are waiting to be printed out till you send your next message
it needs fixing lol
but i'm over the moon for this at least worked lmao
yo?
sorry im back
lmao
yeah exactly
this happened to me once as well
yeah
or with enough time, i'll be able to fix it lol
or neural nine's there for help anyways
lmao i used him as well
in fact i even refer to him in one of the pinned message in this channel
yeah i saw that lmao
the videos are pretty good
noicce
ah, and how do i update the server file in the future?
and how to stop this instance? since it only has like 750 hours per month or something ig
you never need to
oooh
i have no idea lmao
lol
the scp command, then the ssh to restart it
its annoying
i would create a batch file to update it
i don't know how to do that
i could make a python script to run the commands for me tho
okay got it, delete it
ye
what was you server script called again
Hey @prisma cobalt!
It looks like you tried to attach file type(s) that we do not allow (.bat). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.
Feel free to ask in #community-meta if you think this is a mistake.
goddamn
bruh
ill dm it to u
yess
ahh we did it
i walked someone through aws setup with pyhton multithreaded chatroom
i just finished coding a little socket client on my goddamn iphone 4s running ios 6
writing code on the little screen is hell
hey if anyone is on i had a question
i have a linux laptop and a windows 10 computer
if my laptop sshs into my computer and runs a flask server, will my computer be able to develop on that server or will my laptop be limited to the server only
is there a way where i can have my windows 10 server running on a linux laptop and edit my files on my windows 10 computer?
Why you just don't start Flask server from Windows?
However you should be able to start HTTP server from different machine and still edit files
There could be problem with reloading server to apply file changes
i want to edit my files on my windows pc right, but i dont have enough space for my terminal to be open for me to debug
i want my terminal on a different browser and i want to utilise ubunut's tmux
I think that it is going to be difficult to maintain
On Windows 10 you have virtual desktops or something similar
i wanted to use the windows 10 ubuntu terminal but i couldnt locate my other drive
and i dont know how to mount my other hardrives
Are you talking about WSL?
It's WSL
is it ?
When you have for example C: drive you can access it by ls /mnt/c/
mnt as it mount?
woudl other drives be mounted by default? or do i have to mount them
All visible drivers, like D:, E: and so on, should be automatically mounted
Try path /mnt/h
You can list all of them by executing command
$ ls /mnt
I don't know any good SSH server for Windows, never used it so I cannot recommend any to you
so if i have a bash wsl running, is that a machine? so in terms that, if my dir is my h drive, i could ssh into my ubuntu bash from my linux mahcine?
I never did it before, you can try 
it works
i setup sshd on my windows pc
and then went on my linx pc and just used my username@device_local_ip
or lan ip
and then it connected to cmd
i dont know how its running but its runnig
That's all? No problem with ports? Wow
I have written a app with flask, websockets, and zerorpc running ontop of gevent. I would like to swap out zerorpc for something where I can list connected clients, and server can send to client without first receiving a request. Any tips on libraries I can look at? I don't want to use sockets directly as I then have to handle fragmentation etc myself. Using protobuf for serializing. Sorry if this is the wrong channel
I'm trying to port forward and I need some help. Can someone tell me what External Source IP Address means here? What do I have to fill in? Thanks
The public ip probably
hmm okay, thanks
@warm kite what router is this? External source port number might need to be filled as well?
It's an Huawei router, i don't know much about routers, so thats it. And no, if I fill the external source port number, it will only redirect incoming requests from that specific port number only. I don't want that. I want it to redirect all requests that are incoming for port 5555.
Eh, my mistake. Didn't see the external port number on the left side... Just the one right below the internal port numbers. Should have looked at the image for a second more.
cool, but I don't understand why do I have to fill in 5555 in both my external & internal port number? Whats does external port number imply?
internal port number is the port thats on my laptop, right? the one that i'm running my application on? so whats with the external port number?
you can set port x as external and port y as internal so any traffic incoming on port x will be forwarded on port y
if they are the same then the port number simply doesnt change which is usually waht you want
an example would be setting port 8080 lets say for ssh'ing which usually uses port 22
so 8080 is external which is where people access it and its forwarded to port 22 to ssh
Oh, got it. Thanks a ton man 🙌 . Also I can leave out the External Source IP Address, I don't need to fill that, right?
Hello. I am trying to build a python online game using sockets and udp protocol.
I created a multiprocessing and multithreading server: https://pastebin.com/ZucxWPC9. I will explain what the code in there does. So first it's waiting for two requests and puts them in lobby list. If two requests have been made, the server sends the clients a new port and creates a new process with two threads. Both threads are using the new port , one receiving and the other one is sending the data. I am using a queue so i can keep track of data and avoid using the same resource in the same time.
The client is a pygame game. I made this small test game of squares moving where the mouse position is. https://pastebin.com/QdKU6Rij. I have a connection class which i put in init of the game. At first i used multithreading for the connection as well but i observed it was running really slow (i dont think it was threads fault now but i really have no idea). So the curent connection class connects with the main server, waits for a port to be send and starts a new process with two threads: one listening for data and one is sending. I used a queue in there as well even though the multiprocess queue is slow. It was just for test purpose.
There is also a file in there for global variables (in case you want to run the code) : https://pastebin.com/RhDwjeKQ
The problem with this code is that it gets laggy until it completly freezes. At first it works really good but after a few seconds the square looks like it teleports. My guess is that there might be a memory leak or something i have completly missused, and not really the problem with sending and receiving because my square is laggy too and when the program freezes there so more printing from the update function either. Everything stops.
If you have any idea why this happens I will be so grateful. I have to finish this project before 30 this month and I am really lost because of this problem. Any advice is really helpful!
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Anyone here who is familiar with sockets, ssl?
Do you use any infinite while loops for pretty long? Once I had a infinite while loop in a program that automated the launching of zoom meetings, after about 5-10 minutes of it running, my pc started to heat up and CPU usage touched 50s with high click speed lmao, so ig that could be the reason for bad performance
Try posting your question so we can answer
I'm looking for someone who would like to help me a bit with a socket, ssl requests sending code. 🙂
I need the code to open a connection between a api, and then sending requests thru it.
yes I have but I dont know any other way to make the program work
Calling sock.sendto as fast as possible might not be the best idea ?
Try to implement a fixed update loop. Have it run like 30 times a second.
Also, p = multiprocess.Process(target = new_lobby.. are you spawning a new_lobby process every iteration of the loop?
#Arduino #Elegoo #MEGA2560
This is the Elegoo MEGA 2560 R3 Complete Starter KIT
► Buy: https://www.amazon.it/dp/B01JLTVX6U
Elegoo MEGA 2560 Starter KIT is for advanced users like professional lab engineers, electronic major students and experienced hobbyists for Arduino projects.
Quantity and quality are both important here in Elegoo MEGA 256...
@solemn relic thank you for answering. I will try making sock.sendto slower. I am not spawning a new lobby every iteration, only when len(lobby) == 2 (2 clients who sent message. After I start the new process lobby list becomes empty and waits again for two clients)
@ember ledge static IP is offered by some ISPs - at least where I live. Often costs extra. One solution could be a dyndns service if you control the computer you are connecting to?
Or make the while True: slower? My first attempt would be adding a sleep at the end. If you want to evolve your game loop more you should read https://gafferongames.com/post/fix_your_timestep/
He also has some very good articles on other aspects of network programming for games.
@solemn relic I tried making it slower but the game works slower now too. I first made the server slower and it almost stopped the game. I made the client slower and happned the same. I made them both and it was even worse . I used asyncio and waited enough for only 30 packets and when I ran the client code it was terrbile. I ll read what you send
Might be a need for interpolation https://gafferongames.com/post/snapshot_interpolation/ 😉
Yeah, but how does that work generally? Do they charge you by IP or is it just a fee for the whole protocol?
Looking into DynDNS but I don't really know what it is.. And of course... I'm only connecting to the computers I can control.
thank you! I am reading it now
They charge for each IP. DynDNS basically lets you "automatically" update where somename.mydomain.com points. So if ComputerA got its external IP changed it will tell the DynDns server which will update the DNS record for somename.mydomain.com to point to the new IP
I personally use namecheap's DynDns service with a custom domain for some services; like my parents connecting to my VPN server etc, since my current ISP doesn't offer static IPs at all.
All right so is my idea crazy?
@ember ledge I have a dynamic IP too, so I use a dyndns service called NO-IP. It's basic plan (free) allows you to use 3 hostnames per account. It's pretty cool. They just have a 10mb software that gives you a host , it checks ur public ip every 3 minutes or so, and updates the hostname with the public IP. Here:
https://www.noip.com/
dyndns is just the name of the service. It is actually implemented through the various instruments like NO-IP and name cheap and many more.
I'm not a pro on this stuff too, but since I've been using NO-IP for a while now...
who here has worked with Text_FSM
can someone help me with ip configuration? i don't have much experience
Hey guys
I did implemented a UDP video sharing protocol but after some changes it does not work
Client side gives segmentation fault error
Hey @arctic kestrel!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
lmao I'm probably not the one you're looking for, sorry
Hello everyone, there is a Segmentation Fault error in this codes but I couldn't find the reason. I tried to use faulthandler, it gave me:
[WARNING] stderr: Exception in thread Thread-2:
[WARNING] stderr: Traceback (most recent call last):
[WARNING] stderr: File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
[WARNING] stderr: self.run()
[WARNING] stderr: File "/usr/lib/python3.7/threading.py", line 870, in run
[WARNING] stderr: self._target(*self._args, **self._kwargs)
[WARNING] stderr: File "main.py", line 201, in camera_receiver
[WARNING] stderr: faulthandler.enable()
[WARNING] stderr: AttributeError: 'LogFile' object has no attribute 'fileno'
Server: https://paste.pythondiscord.com/jorecejexa.py
Client: https://paste.pythondiscord.com/wawuqanema.php (It works in a thread)
EDIT: SOLVED THE ISSUE
Here is the solution: Do NOT trust the "set" function in OpenCV library since it may not set the resolution to what you want! Just I've used a get() function to get dimensions and saw that it is not the dimensions I set before 😦
Could you help me please?
anyone know how to set up a secondary wifi router with no ethernet cables being connected and for it to be able to still work with the primary router being off?
i just wanna use the internet as my dad keeps turning it off when hes done using it which is kinda selfish and even my mum agrees
Not sure secondary will work with primary router turned off
Or could there be a hack for that ?
So if anyone's interested here's a great series on the osi networking model:
https://www.youtube.com/playlist?list=PLsoPy7S6vUtHQhDr45yuELQmocpRAJV3F
I want to make a program that detects when a device connects to my wifi, how would I do so?
Does someone know something about OPUS in python?
i really cant find anything on the web ...
i need it to encode audio recorded with pyaudio
Hello their, i try to connect my flask app with flask_discord but when i'm login it return that :
Can you help me?
what port is your server listening on
I have a few questions about best websockets libraries to use in Python. https://www.reddit.com/r/learnpython/comments/mo85yd/best_options_for_streaming_audio_over_websockets/
Any help would be appreciated!
0 votes and 0 comments so far on Reddit
guys I have a question
Around how long of learning does it take until you can get hired by countries as a python expert?
how does this relate to networking? try #career-advice
thanks mate
did you actually ask there?
anybody here with websockets experience? Is Autobahn python a good solution for latency-critical audio streaming or would I be better off just using "vanilla" websockets?
Hi
Is there a DNS library for python that allows me to grab CNAME records for a domain?
I searched and there wasn't, there is a Toolbox provided by Google that does this stuff but they don't offer any API; is there any free API without rate-limit to grab CNAME records?
Hi, so my router has a USB input, and recently I discovered that I can connect my HDDs to it to create a local server in the network, however, it uses SMB1, so is it a good idea to run it?
Also, does the connected Device, aka my PC gets those security vulnerabilities by enabling SMB1 in control panel?
hey, i have a question altho i'm not sure if this is the right place to ask
but i think it's the closest one
so, i was trying, not for illegal porpoises, to connect to an FTP server using proxies
but it does not work like requests, i mean, with requests i could have created a proxies variable, giving it the url of my proxy, and then ad the moment of accessing the site i would have written requests.get('site's url', proxies=proxies)
but i can't use the argument 'proxies' with FTP
when i create two UDP sockets in my python server only one of them will recieve packets from a client. How do i have 2 sockets working in the same program?
wow, i just noticed that noone ever answers questions in this channel
oh, sorry (,:
Just because you haven't gotten your answer within the first 10 mins. Although I see your point with the steak of unanswered questions above yours lmao
yeah, i can wait days for my answer
also bc i found a way but it doesn't really work that fine
i said that bc of the ananswered quests before mine
but i was superficial and looked only at like three of them
I help with sockets but anything other then that is beyond me 😂 sorry
can't blame them, they don't get paid for this shit anyways 😛
Hi all
does anyone know how to get the open ports within a segment of a LAN
in python?
Look up a port scanner
Use threading
Like, pack all of your functioning server code inside a function and launch two different threads running that function so that you'll end up with two servers within one program
can i use same requests session after rerunning program? i want to have same session for like 10 program runs
Can someone help me out whit this?
Basically I was trying to make a server on python with sockets but I can't solve the problem with the Ip as despite I have tried various types or the server or the client does not accept them
Can you show your code?
I don't know how
I can only paste it
import socket
HOST = '255.255.255.255'
PORT = 3000
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen()
conn, addr = s.accept()
with conn:
print('Connected by', addr)
while True:
data = conn.recv(1024)
if not data:
break
conn.sendall(data)
Your host ip doesn’t seem to be right
Try 0.0.0.0
||6.9.6.9|| --> it would probably work lol
Thank
The 'SuS' number
But it still don't work for the client
Hey everyone. So I just learned about this server and joined as soon i could. So basically I have a project idea that we con do in groups. Please tell me if anybody is interested. I can't do it alone. It also needs a feature that two distance people should be able to connect. Can anyone here help me?
wel will work together
someone said to be a good cybersecurity expert, you must understand networking to the highest degree
My pleasure lmao 😁
What's the project exactly?
hi
Hello @peak zealot, it's topical chat where you talk about network things. You have several offtopic channels (like #ot0-psvm’s-eternal-disapproval for example) or general chat #python-discussion.
ok thanks for information
Hi Guys I want send Json Data to target Ip how can i do it?
What do you mean?
Sample: 89.163.142.192:30120/players.json
How can I send data here
manual
@clear bobcat Any Information?
You can use requests library
!pypi requests
Thanks
Best way to set up a nas that i have to pull data from?
Im a beginner, so if im wrong about something just say so
Sockets ig
Tell me more, maybe I can help you figure out some stuff
Nvm, i got it figured out
is it bad pracrice to have a server with multiple udp sockets for each client on different threads?
i feel there is a better way to do it
If anyone knows anything about flask and/or web sockets, kindly take a look at this question please: https://stackoverflow.com/questions/67060460/how-to-restrict-access-to-one-tab-to-prevent-merge-conflict#
What's up, everyone? New to this sever but glad to be here. Frankly am not at all good @ coding/programming (took a class and cheated my way thru it), and am much more sales/marketing based.
Looking to connect/network with any software devs for a project idea of mine. Would love to chat, Also, I am assuming this channel refers to "networking" as in connecting w/ people. If I am wrong and networking is a coding term, apologies. Cheers 🤙
nah ig, that's the only way by using threads to run multiple socket servers in one program and i don't think there's anything wrong with using threading for that
if it's possible to keep track of the IP's of the connected users, just make it so that, if any user is currently editing the form, no other user from any other IP address can edit it simultaneously. there can be one and only one user at a time. just don't accept any other connections while someone's connected. and about the timeout, use the time or datetime module to keep track of time elapsed since the one particular user is editing, if it's 2 hours, send him somewhere else
Networking is indeed a programming term, but hello nonetheless!
For the time thing, I was thinking of using a token, wdyt of that?
Can Vue JS handle web sockets, or should I use flask IO socket?
lmao i have no idea of anything about vue js lol
Vue can handle web sockets with socket.io
And you need to use flask IO socket
@stoic elm Do you want something like google docs that even a change of a letter updates the docs or when the user clicks "update" update the interface?
Preferably I want sth like Google docs, but is it easy?
You would use to need websockets
and use Vue to handle every change in the docs
and then send the information changed via web sockets
or display the new information if received
any new data
I mean, is not hard but takes some work
If you want a easier path
Just update the data
when users click in the "update" button
then you can use SSE(Server Sent Event) to update the data
Is not hard to implement
take a look at this example
you just would need to use Redis thoe
I didnt find any flask package that handles sse without it
hy guys can you help me?
I'm developing a reverse shell, but for allow that to communicate in wan, i need port forwarding...
I tried with openport+ open vpn.. But it worked only yesterday afternoon..
Can u help me?
i dont using the port forwarding directly on the router..
i'm using openvpn for configuration and openvpn as a "host"
i activated the DMZ on router, and, disable the firewall on pc (server part)
what ipv6?
isn't ipv4 your local ip address?
Hello, what's a good free API to use when I just need to send some data online to access it again from a another service? (using python)
go in your router and set it up
if hardware blocks the ports there isnt much you can do about it lol
alright guys, all working perfectly
Looking for buddy to pair program and learn, advance projects from https://data-flair.training/blogs/python-project-ideas/
i'm just beginner in python, like 4month already 😄
dm if is you interested
I'm currently using my work laptop for my studies, however there are limitation as to what I can install due to admin right which is expected. I have always used Windows PC/laptops, I do have a desktop PC but now thinking of going for a laptop that I can use personally with the benefit of portability.
I'm studying for my CCNP, and will need to run GNS3/VMware/VirtualBox, I know that Virtual box gave me issues on the Windows laptop with Intel Processor so then started to use VMWare which resolved the issue.
I'm now thinking of purchasing a Mac Book Air/Pro, though not decided which one as of yet, but can someone advise if I go for the Mac Book Air with the M1 chip, will that support virtualization, ie VMWare/Virtual box. Furthermore, I'm now learning programming also (Python), from what I read some features of Python are built into MAC, but on Windows you need to install subsystem in order to run Python.
Thanks in Advance
@neon wing python works perfectly fine on windwos
theres a windows installer at https://www.python.org/downloads/
and im pretty sure mac's python is outdated
though this question is off topic for this channel
both windows and mac have 3.9.4
if you want m1 youre probably restricted in software and im not sure if vmware/virtualbox works on m1
i know parallel exists
you'd have to check for software compat. yourself
edit: mac's default python
the m1 i pretty new, so software compatibility might prove to be a concern
How do I get starting in networking for python?
What do you want to do? Create own client/server application? Work with raw internet protocols?
ultimately my goal create my own SD-wan in kuberneties at an ISP level WISP, with public wifi networks at a large scale with a mix architecture of arm64(RPI) and x64 in mind. This also includes AI as a governor for autonomous learning and governance. I dont know where to start. its an idea i have been playing with for some time now.
It will handle customer data at some point, directly or with a api handshake.
so I have no idea where to start with the above Idea.
networking is a broad subject... is there something specific your trying to do?
I don't know what is SD-wan
I have some experience with internet protocols but that's all
SD-wan means Software defined network
New term for me
Build custom company software to fit company needs.
So basically have a software that has prepackaged wholesome internet needs met build for the cloud and micro edge locations(using raspberry pi 4 8GB cluster as edge locations).
This is all running on kuberneties clusters.
if you want to know more.
https://g.co/kgs/kjiRYg
SD-WAN is an acronym for software-defined networking in a wide area network. SD-WAN simplifies the management and operation of a WAN by decoupling the networking hardware from its control mechanism. Wikipedia
https://www.fortinet.com/products/sd-wan for more info and company example of what I am trying to do.
I checked Wikipedia but thanks for the links! I will read more later about it because it looks very nice!
so with the format to code in an ideal of SD-WAN it is my idea to make my own software to have to then use for myself and then maybe later lease out to 3rd parties. @clear bobcat
Do you want to do it in Python? Or Python is only to make a prototype? 
Ideally if I can stay within python as the majority coding path. This is to do with simplify the number of total amount of tools and staying in the py ecosystem.
The maintenance crew for the code is going to end up being cheaper.
I dont what my code to break long term.
As i heard JavaScript code tends to break more as of lately with its high velocity development going on with it.
I heard rust and python combo can work together for better speed(best of both worlds)
So yes as a prototype because I want to get this idea in a tangles state to then show investor that what I am doing is possible.
Some companies like CloudFlare use Rust for network programmig as far as I know 
But if I can keep most of the code in python/rust/pthyon AI code combo that would be great.
It can be good choice to make some parts of your code in fast technology
Yes, I did see this about cloudflare. I think i saw their code on GitHub (drool....) as a docker image(s).
It was written by in PUREEEEE RUST :DD
Thank you for your suggestion still. 🙂
Glad that I can be helpful 🙂
When you are not using unsafe then you have really fast and secure code
My issue is I am trying to make an ecosystem with my product line. one thing I am unsure about is arm64 in an SD-WAN set up.
The raspberry pi 4 8GB is ARM
Can python run on arm64?
Can rust run on arm64?
How do I get python to interface with a vending machine somehow as part of a docker image that is running as a cluster in edge kuberneties?
"Wifi vending machine"
This is for the public wifi part of the network in high traffic areas.
I had Python on my old RPi 2 and it works very well
Rust had some problems with newest features 
Are you good enough to writhe such a code for my project? 😄
I don't think so, I am amateur in Rust 😦
whaaat? I did not hear about this. I am listening 👂
well your better then me! :DDD
I think that it is important to note that unsafe isnt really going to be slower than safe rust (because most safe rust is just highly tested unsafe code under the hood)
You just have the advantage of not having to immediately worry about how you're handling pointers and allocation
but doesnt stop other people miss handling unsafe in crates 
I mean that when you are not using unsafe then you have safe code, it doesn't mean that when you are using unsafe you have slow code 
I used some features which were unstable on ARM but it looks okay now
im confused 😕 what you just said.
oh???! im listen. why is that?
fn foo() -> String {
use std::mem;
unsafe { mem::MaybeUninit::uninit().assume_init() }
}```
is still unsafe, just more hidden 
I don't remember what it was, it was about one year ago
You should notice that some features can be available on x64 but not on ARM for some time
Yeah, that's right 😂
If it was a year ago chances are it's moved along way since then
there have been some fairly major architecture changes for LLVM and Rust in the last year and most importantly bug fixes 😅
Hi all
I need some help with my code
the code is not working with class but the code is working fine without class
One of the reason I need arm is because of its low power for low power bills in 2nd and 3rd country electric rates.
even in a cluster its still comparably low power compared to a hardware nuc cluster. although nucs are better for performance individually as well as a cluster of them, My vending machines are ruling on hybrid solar power kits. so lots of complexity in this puzzle to get internet to persons in 2nd and 3rd world countries (for the last mile of internet)
exhale thats a mouthful to say....
PS nucs using 64bit architecture CPU's would simplify deployment but again I am on electric power constrains.
SO I see rules as something I can use to keep the speed up and the power bill low, but then again, have AI requires python.... which I need more Hardware spec power.
Im feeling stuck here in trying to plan this out.
Open help channel and we will figure what is going on
#❓|how-to-get-help
It's topical chat to talk about network-related things
How about RISC-V? Have you checked out this arch? Is it usable now?
anyone here tried to transition from ip networking to devops?
Im listening. What do you mean? What general topic are you pointing too?
As far as I know RISC-V CPUs are low power too however this architecture was under development when I checked it few years ago 
https://packetpushers.net/edgeq-shares-details-on-a-new-5g-chip-for-the-openran-market/ This written in 2021
The chip uses RISC-V architecture. EdgeQ says it will allow service providers and telcos to program the chip using C/C++ @clear bobcat
Well that is a curve ball... how is this programming language going to work as a docker images.. and a kubernetes cluster ?
This is an endless loop of architecture questions.... (head spinning )
Interesting 
I think that you should pick well-known arch because it's easy to maintain in long term
And remember about Intel Curie history where companies spent a lot of money to learn their employees how to work with those devices and Intel just stopped production
WHAT? GOT article link?
Agreed.
https://community.intel.com/t5/Intel-Makers/Intel-Curie-End-of-Life-Scheduled/m-p/397070#M22117
However it looks offtopic here so we can move to one of the offtopic channels
Hi!! I'm in a mix of sensations: shocked, upset, stunned.. we were working for a year with development a new product using intel curie, now all this work goes to trash. Since the beggining for being honest, intel curie had lots of problems: lack of documentation mainly, problems with software appl...
Well another reason I want to use both a hardware cluster and a kubernetie clusters is because I can put my spread compute power for the company work out in a decentralized way in these hardware clusters around the world that is solar powered.... 😉 the box is no bigger then a vending machine for an edge location.
What I am talking about has never been done, nor there is no such code that is available. I crawled through the internet so I know this business model does not exist.
So you are going to be first one
yes!
Good luck then!
Please come help me .. i have the idea but I dont know how to code...
Grab some help channel, we can talk about it
I would rather go to the DMS so I am not having someone get to be my competitor(s) because I spoke out my idea for free.
You can DM me as well
I gave away docker and kuberneites some years ago... so yeah.. also I never got the credit for the idea.... at least the credit man...!! nope Google did not give me credit .....
This is one of many ideas I had but i did have the skill to get it done....
Yes I am telling you I single handled-ly changed the course of the tech industry with docker/kuberneties idea.
is there any RUDP library for python?
Anyone here know anything about securecrt I am trying to automate configurations with my network with it and I don't have access to my routers and switches when I'm not at work is there a way to troubleshoot with crt on a virtual cisco router/switch?
Hi I needed help with deploying a socket script on heroku
Logs
when i use a debugger, I get to know that my client connects to the server but is unable to send/recieve data
but on the logs it does not show that I connected
I have a similar system in real life and the connection is via wifi how would I allow only 1 packet lose and keep the system working after said package lose, using UDP
is there no way to ensure that a single packet can get lost without affecting the functionality of the system ?
take your meds
oh the two generals problem
if you need all packages to go through:
assign a unique key to each package
send the package again if no confirmations comes back
on the receiving side dont progress a package with a key from a package that has been processed already but send a confirmation regardless
Well depression pills?
no schizophrenia pills
you're delusional, but I'm sure you've been told this many times, so I was just joking
Whats your objection to me being the original concept creator of docker and kubernties?
First of all, I don't think that docker is such a complicated concept at all - lots of people could have separately come up with it
Second of all, you supposedly don't even know how to code, which of course doesn't disqualify you completely, but it does make it less likely that you encountered the problem docker intends to solve - different environment setups
Well sleep deprived, and looking for meaning, purpose and love, with a place I can feel welcome to call, "home", amongst others is what I seek.
I create to make the work a better place so that I can achive my personal goals.
If you have honesty to speak to me they way you feel and/or think then I am listening. But don't gaslight me nor put your disbelief of my deeds (towards me)on me in a format such as passive aggression.
This is the internet, there is alot of things that happened, some strangers to us yet they are closer to our hearts because of the shared passion and camaraderie.
So speak your mind, heart, soul, emotions to me fully. don't be passive-aggressive to me or gaslight me.
My claim to fame as I placed into this channel is not the only one I have. but I have kept mostly quiet about what I have done in my past, I seek a better tomorrow for me, as well as for all.
Edit: this does not make me mentally-ill because of my claim.
We are strangers you and I.
So it is difficult to explain my life in the short few moments we have first made contact today.
Sorry to break it to you, but this is the networking channel in the official python discord server lmao
@glad kestrel whats your idea?
Kuberneties and docker, but I gave it away the idea and let it become opensource.
I just asked to be remembered and have my name on my work as I passed the idea in collaboration to others. But sigh.. I ave been forgotten about...
Well I help create what is easily billions of GDP in the tech industry, and paradigm shift the whole Technology industry in many ways.
People called me a dreamer back then, and unrealistic back then when I when I was trying to dream up and explain what docker and kuberneties was...
Some made me feel crazy by their scorn and/or scoffing aimed at me.
Letters on a screen, a mask of a computer that we can hide behind.
But I made it, I got my idea out there to change the world.
Now I see I can change the world again with another Idea.
Yes and what is that idea?
Does a json post request to an api is encrypted when it over https?
Docker and Kubernetes
TL;DR, sorta yes
specifically encryption wise look at https://www.cloudflare.com/en-gb/learning/ssl/what-is-encryption/
sorta? is there exceptions case?
not really, read the links i sent
okkk
you're the creator of docker and kubernetes !?
@trim moth its up to you if you believe him or not
but this new idea 😂 ?
Yeah lol
i mean...
docker werent the first one to containerize software...
and the creator/inventor/founder of docker and k8s has probably something better to do than rant in a discord for python beginners
True dat
Ok so I worked on a project where I used a company's FTP credentials to get their inventory file. Makes sense it's one credential and all their customers use the same credentials on FTP to get the same inventory file.
So from here my understanding is that a company has a FTP server and if they give their clients and customers the credentials they can get the files.
I emailed another company if I can get their api to access data.
But the representative of the company said, they need our FTP server.
from aiohttp import TCPConnector
host = '194.106.175.218'
port = '8080'
connector = TCPConnector(local_addr=(host, port))```
im trying to build a connector here with a https proxy but im getting an error
OSError: [Errno 10049] error while attempting to bind on address ('194.106.175.218', 8080): the requested address is not valid in its context```
So my question is, if we create our own ftp server and give the credentials to them they can upload their inventory files to it?
Wouldnt it be too much work for them to have to keep adding credentials for all their clients and upload inventory for all of them?
can i use a network to communicate between 2 languages?
yeah, with sockets at least... i think maybe
im 100% sure that i might be correct
Try another port?
try a different port, if that doesnt work try setting host = '0.0.0.0' and see if that works?
yes thats usually how two languages communicate. eg: you have an application written in kotlin/js and a backend written in python. in order for the app and backend to communicate bw each other we use HTTP connections
you caught him red handed
why would it return more than one thing? You only call the function once
maybe you want to wrap it in a while loop?
yield
perfect! thanks
Any tips for making a socket all the time alive, so 18 requests can go thru? - After 2 it stops responsing with a status code.
Can you show your code?
Yes.
i = 0
data = []
context = ssl.create_default_context()
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect(('api.minecraftservices.com', 443))
with context.wrap_socket(s, server_hostname='api.minecraftservices.com') as ss:
while i < 6:
for bearer in BEARERS:
ss.send(b'POST /minecraft/profile HTTP/1.1\r\nAccept: application/json\r\nAuthorization: Bearer ' + bytes(bearer, 'utf-8') + b'\r\nHost: api.minecraftservices.com\r\n\r\n{"profileName": "' + bytes(target, 'utf-8') + b'"}')
data += [ss.recv(10000).decode("utf-8")]
i += 1
There you go!
I see 
What if you temporary omit ss.recv(10000) part? I mean comment it and run again 
Have you tried to see what is going on with tools like WireShark?
I'm pretty new to socket, so there might be some things i wont understand 😬
Haven't tried..
But not sure if i know how to tho..
WireShark is a tool which allows to see network flow (packet by packet), maybe connection was reset or something 
I see that there is a User's Guide https://www.wireshark.org/docs/wsug_html_chunked/ however it's very intuitive tool
Download it and pick some free help channel, we will see what is going on
Alright, will do!
import socket, time
sock = socket.socket(socket.AF_INET , socket.SOCK_STREAM)
ip = socket.gethostbyname("www.marca.com")
sock.connect ((ip, 80))
while True:
sock.sendall(b"GET / HTTP/1.1\nHost: www.marca.com\n\n")
bufsize = 50
output = " "
buf = sock.recv (bufsize)
while (buf):
output += buf.decode("utf-8")
buf = sock.recv(bufsize)
print(output)
print("------------------------")
time.sleep(1)
while testing out this snippet of code, i wanted to make the request-response repeat itself every second but it gets stuck on the second iteration onwards
then i get a brokenpipeerror
I'm trying to connect my computer to my esp8266 which uses microPython
here's the server code(laptop)
import socket
mes = 'hello there!'
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((socket.gethostname(), 3333))
s.listen(5)
while 1:
clientSocket, address = s.accept()
print(f'You are connected to {address}')
clientSocket.send(bytes(mes, 'utf-8'))
here's the microPython code(esp8266)
s = socket.socket()
host = '192.168.29.157'
port = 3333
addr = socket.getaddrinfo(host, port)[0][-1]
s.connect(addr)
the code fails at the last line with this error
OSError: [Errno 104] ECONNRESET
NOTE:
the code given here works fine-https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
and the server also works fine
should i just open and close the socket for every iteration?
no it’s name only 😂💔 .
Ok 🙂
I tried it
he get me this <generator object port_scan at 0x7f2dd33fb9e0>
why ??
instead of doing port_scan(ip)
do for port in port_scan(ip):
the whole point of a generator is that it returns values as it calculates them
@gloomy root did you open sourced how to automate the RSS feed parse in your Crunchy bot?
I am confused while looking at the source codes.
errrrrrrrrrrrrrrrrrrrrrr maybe?
Idk if i finished the new system for it or not
ah i didnt
well the TL'DR it just uses a task which waits every n seconds in a while loop and uses FeedParser
You mean @task.loop ?
the equivalent of that yeah
the webhook system itself is done on a seperate web server
?
https://github.com/ChillFish8/Crunchy-API if yer feeling real brave and wanna try sift through the old source code 
Ok...I will try but I don't think I can make it
I am a dumb coder :grin:
https://github.com/Crunchy-Bot/events is where it will move to eventually
Anyone here a heavy networkd user with IPv6? Anyone contributed to it before?
latter is still wip
else:
ip_address = input("Enter the ip address and range that you want to scan(ex: 192.168.1.1/24): ")
print("______________________________________________________")
print(" IP\t\t MAC Address\t\t MAC Vendor")
print("------------------------------------------------------")
scan_result = scan(ip_address)
result(scan_result)
Enter the ip address and range that you want to scan(ex: 192.168.1.1/24): 192.168.29.1/24
Traceback (most recent call last):
File "s.py", line 35, in <module>
ip_address = input("Enter the ip address and range that you want to scan(ex: 192.168.1.1/24): ")
File "<string>", line 1
192.168.29.1/24
^
SyntaxError: invalid syntax
can someone find wht this error means
Are you using Python 2.7?
In Python 2.7 the input method instantly does eval(), hence the syntax error
this might help as well
sending the thread
Always use ipaddress.ip_address() to validate and store IPs.
>>> from ipaddress import ip_address
>>> ip = ip_address("6.9.6.9")
>>> ip
IPv4Address('6.9.6.9')
Thx
The problem was the evaluation of the IP address which was initiated by the input method, thus the exception
In any case, this is a great approach regarding the storage 👍
Ya, just use the .compressed method when you need a str
Or .exploded or .explod (can't remember name)
These are the same for IPv4 but standard ways to represent IPv6
hello
can i make a multiplayert game with python
is this possible
with pygame also
if so
how?
yes
sockets
TY
hii anyone use virtual box?
anyone have any idea plz share how to connect net in virtual box
Actually I need some virtual machine to use from inside ubuntu
I wonder which one to choose the best
Gnome Boxes looks best ubuntu choice
is there a way to create chat room accessible world wide
using a password
because every tutorial i see of sockets is on the same pc
😔
Hi guys,
Can anyone share some link or advise on the doubt im having
Suppose two ASBRs learn about two different network pre-fix how will the interior routers with in the AS running IGP learn how to send traffic to the correct ASBR for thier respective prefix
Yeah pretty easy to do
You know that altho the tutorials use the same pc, if you simply change the IP to an external pc you can connect to it
Check the pins for an introduction
but the ip is lan ip right?
🤔
You might have to port forward, in which case you should check the pins
You can use a public IP
Again you might have to put forward
is there a tutorial for it
Port forwarding?
yes