#networks

1 messages ยท Page 16 of 1

thorn stratus
#

found by googling "netcat python"

empty solstice
#

https://github.com/rhelmot/nclib
@thorn stratus no no bro they were suggesting the script of netcat
the program that was already there
and I specifically wanted a python listner
IK this too I have used them both

thorn stratus
empty solstice
#

yeh

#

then if you find one by chance then you can DM

#

thanks

thorn stratus
#

You aren't writing it yourself? This is the wrong server

#

||skid||

empty solstice
#

You aren't writing it yourself? This is the wrong server
@thorn stratus why??
I tried tho

#

You aren't writing it yourself? This is the wrong server
@thorn stratus this was the networking server so I thought I would get some help

thorn stratus
#

Its a python help server

#

You don't need help with writing python

empty solstice
#

leave it thanks

thorn stratus
cinder prawn
#
addrInfo = socket.getaddrinfo(url, port)

Always gives the same error: [Errno 11001] getaddrinfo failed

thorn stratus
#

Wow how useful

#

What is in the url and port variables

empty solstice
#
addrInfo = socket.getaddrinfo(url, port)

Always gives the same error: [Errno 11001] getaddrinfo failed
@cinder prawn maybe the port you entred associated with the url maybe closed

#

so you can't get the info

#

hence you will get the error

#

you will not get any info or connection if the port is closed or filtered
sometimes works for filtered

#

What is in the url and port variables
@thorn stratus the url and the port you want to get an info about that is associated with you target

#

you will not get any info or connection if the port is closed or filtered
sometimes works for filtered
@empty solstice try using an open port that is associated with you target

jaunty aurora
#

@empty solstice What is your use case? What are you trying to do?

empty solstice
#

@empty solstice What is your use case? What are you trying to do?
@jaunty aurora me??
I was building a python backdoor
and I made๐Ÿ˜€
but I was making it custom I mean I copied the backdoor shell script from someone else and customized it
but he used netcat for listening to that backdoor
but I wanted to make a customised python listner for that backdoor
I created it
but it was not connecting due to some error I really don't know why was that so I asked here for some help

#

BTW @jaunty aurora if you know something that would help me you are so much welcome to tell me๐Ÿ˜ƒ
but pls DM me as here they won't allow that
**OR if anyone knows that **

jaunty aurora
#

@empty solstice I think you've been told quite clearly before that we don't assist with those type of applications.

#

!rule 5

errant bayBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious/inappropriate or be for graded coursework/exams.

empty solstice
#

@jaunty aurora ||I'm just doing a pen-testing||

jaunty aurora
#

That does not matter. We do not provide help with applications that can be used for malicious purposes and a backdoor application is certainly not something we provide help with. I advice you to drop this line of inquiry now.

empty solstice
#

That does not matter. We do not provide help with applications that can be used for malicious purposes and a backdoor application is certainly not something we provide help with. I advice you to drop this line of inquiry now.
@jaunty aurora sure

woeful minnow
#

Hi guys , can I use socks5 proxy with scapy ?

ember ledge
#

Anyone clue?

frosty bone
#

response object's .text is a property not a function

#

print(answer.text)

thorny locust
#

how do i disable ssl verification with aiohttp? my organization MITMs all HTTP with a self-signed certificate and i have no idea where the CA file is, so i'd rather just disable verification for now (i know the security implications and it's fine in this application)

#

i tried

    sslcontext = ssl.create_default_context(cafile=certifi.where())
    async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=sslcontext)) as http_session:

but i still get the same SSL error, so clearly the standard PEM file doesn't work

#

ah nvm i got it, i used ssl=False

hardy basin
#

Can i disable Selenium from sending data to Google analytics

#

I need to filter out anything Analytics related when checking a website in Selenium.

#

I can see when i run my tool on my own website, it shows up in Google analytics under direct traffic, that's bad ):

#

Anybody have a good idea to overcome this issue. ?

plain anvil
#

This doesn't really sound like a question for this channel but I suppose one solution may be to block the google analytics domain via DNS

hardy basin
#

how do u mean?

graceful radish
#

Hi there,

This question might sound dumb, but can't resist without asking :P, so bare with me please

I have been always fascinated with the thought of how I can implement a network protocol from scratch by just reading the RFC. But unfortunately, once I complete reading the RFC, I don't get a clear picture on how the implementation should be. But I understand the internals of that protocol. Can any of you folks having experience in protocol implementations can point me in the right direction to go on to implement some protocols from scratch? :)

Any sort of tips would be a great help! :)

frosty bone
#

I've had this experience with implementing NTP and Websockets. the RFC is a nice reference, but hard to see the full picture. sometimes I've had to use wireshark or other means to look at examples of actual traffic, other times I've managed to get by looking at screenshots of people who have done this

exotic solar
#

Can anyone tell me if I have this right?
Cookies are client side, while sessions are usually server side.
Cookies are accessible by the user to view.
Usually you will use a cookie as an access point to some information on the session.
But, you can use just a cookie to store info, though not very secure.

frosty bone
#

yes, a cookie can hold a session ID

#

cookies are automatically sent to the server by the browser as part of requests

#

and cookies have certain rules about which servers a cookie will be sent to. this provides some cross-site security (but not a lot)

ember ledge
#

Python doesn't understand that at least one of these IF clauses would match, thus it complains.

real cedar
#

ok

#

how can i check not happen this error

thorn stratus
#

don't use wildcard imports, its confusing and pollutes the namespace

#

What if the packet is ICMP?

#

or arp

#

@real cedar

real cedar
#

@thorn stratus thx now i am more specific to from scapy.all import sniff, IP, UDP, TCP

thorn stratus
#

Not every packet has a port

real cedar
#

@thorn stratus thanks , i did not know that, i thought every communication has port to communicate with remote host.

frosty bone
#

UDP/TCP has ports

#

ICMP does not

wary thicket
#

hi, i am curious on how to make a script that displays specific network information

#

ipv4, ipv6, dns, mac, etc

#

i know there are command line tools like ip that display network traffic info in the terminal

#

but does someone have python scripts for these tools?

thorn stratus
#

what specifically do you want

exotic solar
#

Ah, thanks @frosty bone

#

So, to check, session variables are stored in the web server and can be accessed with a session ID, which times out every now and then meaning you need to do something to get another session ID to access that data again?

steady hatch
#

Does anyone here know any good courses about networking that is worth having a look through prior to learning cyber security?

gusty flame
#

Hey everyone, I need to understand asyncio. Could someone help me?hacktober_pydis

frosty bone
#

@exotic solar yep, thta's right. When the session ID times out, the user usually has to log in again to get a new session ID. Sometimes you can add a "remember me on this computer" checkbox that increases this session ID timeout from say 1 day to 30 days; you can add more time to the timeout whenever there is activity, this means sessions time out only after a set amount of inactivity

scenic pike
#

anyone able to help me with sockets?

i have a script which sends a continuously increasing amount of bytes and reconnects on every iteration.

when the program finally crashes (due to too many bytes received) i want it to error out and tell me.

i currently have an except socket.timeout: which isn't very reliable because it could legitimately take more than 5 seconds (my defined timeout) to connect.

a general except: doesn't seem to catch this so i'm wondering what other way i can do this?

solar elbow
#

If I wanted to build a browser with python can this be possible?

gloomy root
#

you mean like a browser like firefox or chome?

frosty bone
#

with Chromium you could probably use a python binding for CEF

river niche
#

try giving that a readover

#

that may help also, i know youd have to do some dpi to ensure the packet is full before sending

azure apex
#

Is this networking as in computers or as in LinkedIn

thorn stratus
#

Did you read the channel description kek

frosty bone
vestal magnet
#

Works for me that Networking people should network here

shut robin
#

So ya'll wanna connect on linkedin ๐Ÿ‘€

limber spindle
#

Did you read the channel description kek
@shut robin ^^^^^^

grand salmon
#

hi I am extremely new to networking stuff. let's say I have two computers that are connected to the internet through different ISPs or the same ISP but from different places. is there a way to make contact between the two computers without any third party server or anything like that? assuming further that both ISPs provide only dynamic IP instead of static

hexed epoch
#

what do you mean by "third party server"?

#

do you consider a DNS server "third party"?

thorn stratus
#

you could also just manually share IPs every time it changes

#

you could also run your own DDNS server on the cloud

grand salmon
#

by their party server I mostly mean someone I need to pay to lol

pliant jacinth
#

I know this is a bit of a general question but, what is the best way of connecting 2 clients peer to peer style? I

thorn stratus
#

They need to know each other's IP, so you either need to share them manually or use a service like this one

#

From there you just use sockets like any other connection

pliant jacinth
#

Okay thank you friend

grand salmon
#

nice

rain dirge
#

Can anyone tell me, Where I can find the beginner course, I'm a Ntework student and I want to learn Python for Automation.

atomic warren
rain dirge
hoary sorrel
#

it doesn't assume any prior coding experience, if that's what you mean

wind kindle
#

im trying to make a server, (like when you send "hi" in one computer it appears in the other computer and both of them connect to a server running in my computer using python) just a simple one, it trying to learn networking

help would be appericated

simple flax
wind kindle
#

tysm

ember ledge
#

i need help with pickle and socket
how can i send a dict data to another machine using socket and pickle?

karmic sand
#

Hi everyone currently i am running in a weird situation, where my code ( using epoll with nonblocking socket ) is working for http connections, but in https sock.recv always return empty byte, even though socket is mared as readable

#

Here is the related post, i can copy paste the whole thing here if it's required, let me know

simple flax
#

How can you configure websockets to also work with public ip as it's just raising an error when im giving it my public ipv4 address. It works with localhost though or any other private ip...

thorn stratus
#

You need to port forward if you are behind a NAT

rare field
ember ledge
#

im learning on socket programming
and i have an error:

file name : server.py

import socket
import threading



HOST, PORT = "127.0.0.1", 55555

server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)

server.bind((HOST, PORT))
server.listen()


clients = []
nicknames = []


while True:
    client, address = server.accept()
    print(f"[NEW CONNECTION] - {address} connected to the server")
    data = client.recv(1024)
    print(data.decode())

file name : client.py

import socket
import threading



nickname = input("enter your nickname:  ")


HOST, PORT = "127.0.0.1", 55555
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)


client.connect((HOST, PORT))


while True:
    data = client.send(nickname.encode())

and when i send the nickname
the server spam it...

like that:

the output:

[NEW CONNECTION] - ('127.0.0.1', 61036) connected to the server
hellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohellohello       
#

what is the problem?

zinc bane
#

It looks like your code is constantly sending data to the socket inside your while True.

So you code is essentially doing this

data = client.send(nickname.encode())
data = client.send(nickname.encode())
data = client.send(nickname.encode())
data = client.send(nickname.encode())
data = client.send(nickname.encode())
... # continues forever
ember ledge
#

oh oh

#

k thx man @zinc bane

zinc bane
#

no problem, hope that helps

#

if you want this to repeat, I would create a function, like

def set_nickname():
     return input("enter nickname...\n")

while True:
     data = client.send(set_nickname().encode())
#

@ember ledge

ember ledge
#

no problem, hope that helps
@zinc bane
yup thx i fixed it

hexed epoch
#

explained all the AWS concepts super clearly- though I'd share

#

(by "easy" I just mean I wasn't pulling my hair out, it still took a while to fully understand and implement)

simple tinsel
#

Hi guys, so there's a POST request in a website that I use requests module to get data from.. that post happens after I use GET to receive data from that page, is there a way to make request wait for the POST request that happens few seconds after the GET request?

rare field
#

Hi guys, so there's a POST request in a website that I use requests module to get data from.. that post happens after I use GET to receive data from that page, is there a way to make request wait for the POST request that happens few seconds after the GET request?
@simple tinsel

import threading
def post():
  pass

def get(arg1, arg2):
  pass

# call the get method in diffrent thread and wait for it to complete
get_thread = Threading.thread(target=get, [arg1, arg2])

get_thread.start()
get_thread.join()

# call post method
post()
errant bayBOT
#

Hey @pseudo pond!

Uh-oh! It looks like your message got zapped by our spam filter. We currently don't allow .txt attachments, so here are some tips to help you travel safely:

โ€ข If you attempted to send a message longer than 2000 characters, try shortening your message to fit within the character limit or use a pasting service (see below)

โ€ข If you tried to show someone your code, you can use codeblocks
(run !code-blocks in #bot-commands for more information) or use a pasting service like:

https://paste.pythondiscord.com

pseudo pond
#

any help in this code?

#

dm me pls

errant bayBOT
#

You are not allowed to use that command here. Please use the #bot-commands channel instead.

olive shuttle
#

Here, after opening the link, a file gets downloaded. The next command is supposed to be executed after the file is downloaded. Is there a way to control the execution of findStaticFolder(link) after the file gets downloaded?

late raven
#

what does findStaticFolder do exactly here

olive shuttle
#

It is used to import a fbx file inside a game engine (UE4)

#

the file that I'm downloading using the url in the command above it

late raven
#

check if the file is downloaded to a default location after running the script

olive shuttle
#

well, it might happen that the file is still downloading when I check. Right? So I will have to keep checking at intervals until it shows that the file is downloaded and then I can continue with the script. Is this what you mean?

late raven
#

what is the file size?

olive shuttle
#

It can vary largely

#

from mere kbs to mbs I guess

late raven
#

I see

#

try using requests for the purpose of downloading the file maybe

#

and then pass the file downloaded to the findStaticFolder method instead of link

olive shuttle
#

uh oh!!! My bad, I made a quick change after clicking the screenshot. I'm not passing the link but the path of the file where it's getting downloaded which is set beforehand. Anyways, how can I pass the file downloaded directly? Is it different than choosing a path beforehand where the file is supposed to get downloaded?

latent fractal
#

if the file will fit into memory, you could switch to using requests, as @late raven suggested, with something like this:

import requests

r = requests.get(url)
with open(download_path , 'wb') as f:
    f.write(r.content)
#

the program won't proceed until the download is finished

late raven
#

throw some print statements in there for logging maybe

olive shuttle
#

thanks, will try this out!

late raven
#

Good luck

latent fractal
#

๐Ÿ‘

#

@olive shuttle (i made a typo in the code above, forgetting the 'f'):

import requests

r = requests.get(url)
with open(download_path , 'wb') as f:
    f.write(r.content)
olive shuttle
#
[Errno 13] Permission denied: 'D:/temp/'
#

This is what I get ๐Ÿ˜ฆ

#
url = 'https://www.turbosquid.com/Download/1067193_24018098'
r=requests.get(url)
with open('D:/temp/', 'wb') as f:
    f.write(r.content)

My code

#

Moreover I don't want to run as admin because I need to use this code inside a game engine (UE4)

latent fractal
#

Try adding a filename to d:/temp/.
I.e. 'd:/temp/1067193...'

#

You shouldn't need to run as admin

olive shuttle
#

The download worked but I think it messes with the integrity of the file. Since I'm importing the fbx file into a Game Engine, this doesn't seem to work

LogFbx: Error: Call to FbxImporter::Initialize() failed.
LogFbx: Warning: Error returned: Unexpected file type
FBXImport: Warning: Can't detect import type. No mesh is found or animation track. 
LogAssetTools: Warning: Failed to import 'D:/temp/trial.fbx'. Failed to create asset '/Game/StaticMeshes/trial'.
Please see Output Log for details.
latent fractal
#

did you set the download path to: 'D:/temp/trial.fbx' ? i.e. with open(' D:/temp/trial.fbx')

#

what do you end up with in the folder?

#

hmm, i see that you need a log in to download the file. that explains why requests might not work, whereas using the browser does.

latent fractal
#

the easiest thing would be your original approach and a while loop...

olive shuttle
#

did you set the download path to: 'D:/temp/trial.fbx' ? i.e. with open(' D:/temp/trial.fbx')
@latent fractal yes I did. I have kept my browser open and logged in before I run the script. requests downloads the file successfully and I can see it in the folder, but if I try to import into the engine, it shows the above error. So I'm guessing the file gets corrupted or something.
I will try the selenium approach again. Thanks!

latent fractal
#

i guess that requests is downloading a html file, rather than a fbx file (you can try opening the file that requests downloaded in notepad to check).

logging in with your browser isn't enough to get requests to log in, you would need to use a requests session, and POST the correct data to turbosquid's API to log in. this doesn't look straightforward for turbosquid.

so using the code you have that already works, and looping to check whether the file has downloaded seems like the easiest approach.

good luck!

hardy basin
#

Hi guys,

Anybody here that works with browsermob or har files in general?

#

!close

high oracle
#

guys hello

#

i have question for everyone

#

it is possible to set up a website that cannot be traced in the internet world

open mulch
#

more or less no, but yes aswell

#

tor beacons and such leave much to be desired

high oracle
#

so yes but no

open mulch
#

well technically, if you expose if to the internet, you're ip is available for bots and such to be find you

high oracle
#

Tell me, can we?
If we change the IP address of the website constantly?

open mulch
#

if it's in a local network where it sits safely behind a access list (firewall) and such, technically you're not exposed

#

for example intranet sites are not exposed to the outside web

#

you see, it's very much based on your definition of "can be traced in the internet world"

#

you can set up a site only you can use

#

if that's what you're asking

#

dynamic ip doesn't solve everything

high oracle
#

okey thx man

open mulch
#

np

patent wharf
#

Does anyone happen to have any experience proxying HTTPS requests using Tornado (https://www.tornadoweb.org/) or implementing a CONNECT method to handle this. From my understanding I have to make use of tornados BaseIOStream but so far I have only been able to pick up that a client has called the CONNECT method but am unable to respond to it. I haven't been able to find much documentation relevant to the subject.

empty solstice
#

Tell me, can we?
If we change the IP address of the website constantly?
@high oracle well that will just lead to indexing the IP's you use for the website and that will just create an increased exposing.... but less tracing tho๐Ÿคทโ€โ™‚๏ธ

tribal spire
#

Is this the place where I would ask questions about things like BeautifulSoup?

open jackal
#

ooo python just keeps suprising me,it even has funcions for networking

empty solstice
#

Is this the place where I would ask questions about things like BeautifulSoup?
@tribal spire yeh well you can but it is more likely for automation like things tho

#

ooo python just keeps suprising me,it even has funcions for networking
@open jackal lol

hardy basin
#

Is there anybody here that knows anything about selenium and browsermob?

snow tulip
#

there are plenty of people who know about selenium but you might want to ask in #web-development

open mulch
#

Is this the place where I would ask questions about things like BeautifulSoup?
@tribal spire why not, it probably belongs more to a scraping channel, but there's nothing solely dedicated to that, so why not

#

maybe web dev, doesn't really matter though

gloomy root
#
web_1  | Round 1 |  Sandman:  Requests/sec:   9564.20          Round 1 |  Uvicorn:  Requests/sec:   8298.75
web_1  | Round 2 |  Sandman:  Requests/sec:   9066.42          Round 2 |  Uvicorn:  Socket errors:  read 20, timeout 3
web_1  | Round 3 |  Sandman:  Requests/sec:   9242.25          Round 3 |  Uvicorn:  Requests/sec:   8577.19```
#

So i current have this on my hands

#

which is pretty cool that its beating Uvicorn with 4 workers vs 1 Sandman worker

#

the issue is how df do you load balance sockets across several workers?

#

i feel like just cycling around workers is obviously not how it works because you'd start having stuff go out of sync and other stuff

hexed epoch
#

do you mean websocket connections? or just sockets on the lower level?

gloomy root
#

sockets on the lower level

hexed epoch
#

I'm confused about what you mean by that, what specifically needs load balancing?

gloomy root
#

im thinking more how Gunicorn worker's load balance

fresh gull
#

Hi everyone. Thereโ€™s a question Iโ€™m a kinda beginner.

#

Can I connect to a client on the current network to send data using python socket module?

gloomy root
#

broadly speaking yes

fresh gull
#

Yeah I just tried and itโ€™s working

#

Thanks though but....

#

Can I do something that I can connect to client without any kinda action from the client

gloomy root
#

wdym?

fresh gull
#

I started terminal and started netcat to connect to the server. I mean is there anyway to connect to the client without these actions

#

Ok forget it

#

I have a last question

#

Can the data that I send be any kinda data?

#

Like a executable file?

frail shoal
#

hi, I'm looking to write a server that does some opencv processing, pulls out the data, and lets clients on other devices on lan access a live stream of this data
what should I start with learning for figuring out how to send data like this over a network?

#

I'm not really familiar with what tools or libraries Python has so if anyone can point me in the right direction it would be much appreciated

open mulch
#

what do you mean by a live stream of data

rigid edge
#

covert-ink wow great idea

frail shoal
#

well
like, update a set of numbers at 60 times per second or more

#

I was thinking maybe I could figure out how to set up some sort of web server that returns json and just query that web server over and over if it came to it

#

but ideally some sort of stream where the server is determining a push on update would be best

#

like some sort of subscription and then udp at the subscribers

shy pebble
#

If you want to send from server to client, you can use websockets or eventstream

frail shoal
#

how would I do that in python?

#

ah like this?

shy pebble
#

What are you using for the server? You will have to write some JS as well to make it work. Actually, for video there are also the streaming protocols things like twitch use, but IDK much about those

patent wharf
#

If I am connecting to a service through a proxy, is the service Im connecting to Upstream or Downstream from the proxy?

#

Which is the correct terminology?

wicked ocean
#

my friends keeps screaming in NGINX that they have an issue, but i tried my best to find the issue to no avail

#
server {
   listen 80;
   server_name 127.0.0.1;
 
   location / {
       listen 777;
       proxy_pass http://127.0.0.1:777;

       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

       client_max_body_size 5M;
   }
}
hexed epoch
wicked ocean
#

its only for LAN testing

#

but this server block is throwing errors

#

but im not sure of what

hexed epoch
#

what do the errors say?

wicked ocean
#
-- Unit UNIT has finished shutting down.
Jul 24 01:16:41 {ip} systemd[30928]: Stopped target Paths.
-- Subject: Unit UNIT has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit UNIT has finished shutting down.
Jul 24 01:16:41 {ip} systemd[30928]: Received SIGRTMIN+24 from PID 30941 (kill).
Jul 24 01:16:41 {ip} systemd[1]: Stopped User Manager for UID 33.
-- Subject: Unit user@33.service has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit user@33.service has finished shutting down.
Jul 24 01:16:41 {ip} systemd[1]: Removed slice User Slice of www-data.
-- Subject: Unit user-33.slice has finished shutting down
-- Defined-By: systemd
-- Support: https://www.debian.org/support
-- 
-- Unit user-33.slice has finished shutting down.
Jul 24 01:16:41 {ip} sudo[30946]:   {user} : TTY=pts/0 ; PWD=/opt/nginx-1.14.2/conf ; USER=root ; COMMAND=/bin/journa
Jul 24 01:16:41 {ip} sudo[30946]: pam_unix(sudo:session): session opened for user root by {user}(uid=0)
#

actually this isnt it

#

how do you get the debug log

hexed epoch
#

cat /var/log/nginx/error.log

#

that's the default log location

wicked ocean
#

aight we got it to actually work

#

but we hit another wall, refused to connect error on our site

#
server {
   listen 80;
   server_name 127.0.0.1;
 
   location / {
       proxy_pass http://127.0.0.1:666;

       proxy_set_header Host $host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;

       client_max_body_size 5M;
   }
}
hexed epoch
#

try a port like 3065 or something

restive blaze
#

also, if your application isn't run with root, applications cannot open below port 1024

#

so if you are running Gunicorn with Nginx, it needs to be above 1024 for it to properly bind

snow tulip
#

^

#

don't use port 666 either

#

people might think you're running a DOOM server

#

and when talking about connection errors and the like with HTTP it's always helpful to provide what Status Code was produced

#

and to look at or provide nginx error logs as rdbaker said

olive shuttle
#

Hey everyone! I am using requests to download a file from a website which requires log in. How to tackle that?

  def download_file(url):
    local_filename = url.split('/')[-1]
    with requests.get(url, stream=True) as r:
        with open('D:/Temp/' + local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)

    return local_filename
thorn stratus
open mulch
#

request.Session will be your friend

#

basically, log in in a browser, track which parameters are being posted, and repeat programmatically

#

keep an eye on csrf tokens and the like

empty solstice
#

Hey everyone! I am using requests to download a file from a website which requires log in. How to tackle that?

  def download_file(url):
    local_filename = url.split('/')[-1]
    with requests.get(url, stream=True) as r:
        with open('D:/Temp/' + local_filename, 'wb') as f:
            shutil.copyfileobj(r.raw, f)

    return local_filename

@olive shuttle use selenium if you can

thorn stratus
#

You don't need to use selenium

olive shuttle
#

request.Session will be your friend
@open mulch thanks! I will look into it.

#

@olive shuttle use selenium if you can
@empty solstice Tried selenium before, it's a bit messy.

empty solstice
#

well yes it is

#

I just suggested if nothing happens then you can try tho

olive shuttle
#

hopefully something happens! ๐Ÿค“

empty solstice
#

yes

ember ledge
#

(just bumping message i sent in general)

hey is there are a way i can route an application's (my web browser) traffic through a proxy to (essentially) make a VPN? I know how to send requests through a VPN but it's no use to me if i cant use my browser with it.

thorn stratus
#

Wdym

#

Proxies and VPNs are basically completely seperate

hexed epoch
ember ledge
#

@thorn stratus yeah i know im just using a vpn as a comparison to it, basically just a program that runs (if possible) all traffic coming from the system through a proxy server, or all traffic coming from an application (chrome in my case)

thorn stratus
#

Proxy's are generally for one type of traffic, usually http/https

ember ledge
#

(thats all i want)

#

just http and https would be amazing

thorn stratus
#

Then set your proxy settings on chrome

ember ledge
#

i uh........ lets just say i cant exactly do that

thorn stratus
#

!rule 5

errant bayBOT
#

5. Do not provide or request help on projects that may break laws, breach terms of services, be considered malicious/inappropriate or be for graded coursework/exams.

ember ledge
#

a

#

just my mom got me a laptop and she restricted literally everything on it and i dont even know why

thorn stratus
#

That sounds like something you need to take up with her

ember ledge
#

eh... i can probably figure out a way to watch youtube

thorn stratus
#

I would think outside networking

ember ledge
#

ok but separate from that-
I'd rather not have all my search history looked at by her so can i actually do that? it's not even violating rule 5 thats just basic privacy.

thorn stratus
#

Is BIOS/the boot menu locked

ember ledge
#

No i dont think

#

(and by the way i genuinely do want to get into security as a career so are there any good modules to learn if i wanna start developing a VPN service?)

#

like would socket and stuff be good?

thorn stratus
#

As rdbaker said, it isn't practical to make a VPN by yourself. Security is hard, and takes more than just one person

#

Learning how to securely host a VPN server would be valuable though

#

Are you wanting to do more red team stuff like trying to hack into things or blue team stuff like preventing things from being hacked

ember ledge
#

blue team

#

yeah youre right., but i would just like something that reroutes my internet traffic into a server i find online, if thats possible of course, i probably wouldnt use it since thats very not-secure but it'd be great to learn how to do... do you think thats possible to do over about a month (just something that redirects your traffic to a proxy server)?

#

@thorn stratus

thorn stratus
#

I'm not sure what you mean

ember ledge
#

it would take all the requests coming from your pc and run them through a proxy server

vestal scroll
#

I'm currently trying to get my raspberry pi to connect to a socket to a node js webserver i have running on my pc

#

i can connect to the socket just fine when i run the python socket connection on my pc

#

but when i try on the raspberry pi it refuses to connect

#

anyone have any ideas?

vestal scroll
#

nevermind fixed it

ember ledge
#

can someone help me code a server for my game? client is made in gamemaker studio 2

empty solstice
#

with python?? @ember ledge ?

olive shuttle
#

This might like a stupid question but new to networking so please go easy :(
I'm trying to log in using requests, how to know if I have successfully logged in?

narrow oak
#

it really depends on the website. For instance, some website displays something like <h1>success!</h1> in their html in a success login so you could use something like bs4 to parse that data. Some website also throws back a 4xx status code. It really just depends for what site but inspecting the source (html) and finding differences between a failed and success login attempt will most likely help.

olive shuttle
#

@narrow oak just looked into their robots.txt ๐Ÿ˜‚
Nothing will work anyways, at least legally, I guess.

narrow oak
#

welp, good thing you found out

olive shuttle
#

yeah ๐Ÿ˜„

ember ledge
#

@empty solstice yea why?

carmine nexus
#

Hi, could someone help me with my port forwarding error.

#

I tried opening port 2222 on my router but when I went to check if it's opened (Used port checker) it was closed.

carmine nexus
#

Anyways if anyone is abled to help, please tag me. Thanks in advance!

empty solstice
#

try using a different port maybe @carmine nexus

thorn stratus
#

@carmine nexus you need to be running a service on the port to check if it's open

#

Or else the router will just send the packet the computer, and it will get no response back

errant bayBOT
#

:incoming_envelope: :ok_hand: applied mute to @ember ledge until 2020-07-27 04:42 (9 minutes and 58 seconds) (reason: duplicates rule: sent 4 duplicated messages in 10s).

carmine nexus
#

@carmine nexus you need to be running a service on the port to check if it's open
@thorn stratus You mean like running a website?

limber plume
#

A service could be anything that's listening for a request (website, ftp server, webui for a program, etc)

carmine nexus
#

Ok and lets say I want to host a mc server. I tried that back in the day and it again, didnt work. I used the port I port forwarded (2222) and no one could have connected to it.

thorn stratus
#

Is the server running

carmine nexus
#

You mean like, is it opened to LAN?

wraith grove
#

Sure

carmine nexus
#

Well then yeah. I did that and my friends still couldn't join the server.

wraith grove
#

The server was running on the correct port?

#

Your firewall is open? the IP in the port forwarding rule is correct? correct selection of TCP/UDP in the rule?

bitter kite
#

How do you close a flask webserver without context?(running flask with discord.py)
Trying to close it in another file (flask on api.py, closing it at bot.py)
instance launched with
(on api.py)```py
part = partial(app.run, '0.0.0.0', port=5000, debug=True, use_reloader=False)
t = Thread(target=part)
t.start()

close function needs to be on bot.py
carmine nexus
#

The server was running on the correct port?
@wraith grove Yes

#

Wdym by "Your firewall is open" @wraith grove

#

The IP in the port forwarding rule is correct, and when I was doing it, it asked me if I want to automaticly port forward both UDP and TCP so I chose both.

ember ledge
#

hey how should i start learning networking

empty solstice
#

I started with learning sockets tho @ember ledge

ember ledge
#

@empty solstice any ideas on how i should start

#

like what to learn in sockets

#

alot of stuff are too complicated to learn from

empty solstice
#

well I first did making a simple server and client

ember ledge
#

ive done that actually

#

a simple message sending thing that the client sends to the server

empty solstice
#

yes

#

then make it yourself

ember ledge
#

@empty solstice i didn't knwo how continue

empty solstice
#

well when we see and make then it is easy

#

but try yourself

ember ledge
#

i actually did that

empty solstice
#

there will be too many errors

#

well that were for me tho

ember ledge
#

i also modified it to send messages back

#

but sure ill give it a try

empty solstice
#

yeh that can be done BTW

#

then just try searching some different projects

#

and think of it's logic

#

well I'm doing one myself

ember ledge
#

ok

empty solstice
#

yes

ember ledge
#

can you give me a few examples

#

and i had a question

empty solstice
#

did you try connecting different clients to one server?

ember ledge
#

is sockets the only way to do netwroking

empty solstice
#

yeh ask?

ember ledge
#

or the core of networking in python

empty solstice
#

well for me I have discovered till sockets tho

#

there maybe some other module or something

ember ledge
#

ahh

empty solstice
#

that helps in networking

ember ledge
#

i actually wanted to learn networking cause i do game dev with uniyt

#

unity*

empty solstice
#

ohh great

ember ledge
#

but i got intrested in learning it

empty solstice
#

yeh sockets will help

ember ledge
#

and when i tried i failed miserbally

empty solstice
#

try again lol

ember ledge
#

i made a chat app using file handeling

#

but thats just it

empty solstice
#

Asyncio
Diesel
Pulsar
Pyzmq
Twisted
TxZMQ
NAPALM

#

these are some libraries for networking in python

#

I searched web

#

i made a chat app using file handeling
@ember ledge ohhh great

#

I'm trying to make one too

#

but it is hard AF

ember ledge
#

ooh i know asyncio

empty solstice
#

great

ember ledge
#

but thats not networking

#

its important for networking though

empty solstice
#

ohh

#

TBH IDK really

ember ledge
#

as they are coroutines

empty solstice
#

I searched web

ember ledge
#

you should learn it

empty solstice
#

ohkk

#

yeh I'm a beggineer too

ember ledge
#

i m a beginner in networking

empty solstice
#

or maybe I'm the only beginner

#

lol

#

ohh

#

yes me too

ember ledge
#

i actually completed the entire igce sylybus in 0ne hour

empty solstice
#

what is that?? lmao

ember ledge
#

its a board

empty solstice
#

ohh ok

#

got it

#

where?

ember ledge
#

its an international board by Cambridge

empty solstice
#

ohhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh

#

that's so coooll๐Ÿ”ฅ๐Ÿ”ฅ๐Ÿ”ฅ

ember ledge
#

mmh that too it was my first time programming

empty solstice
#

ohh greaaat

ember ledge
#

so my teacher said i had some potentaial but now everthing is going bad

#

im not able too learn anything new

empty solstice
#

well don't lose hope bro/sis

#

lose*

ember ledge
#

im a boy

empty solstice
#

ohk

#

bro*

ember ledge
#

the image was a commision someone made for me for free

empty solstice
#

what image?

ember ledge
#

icon

empty solstice
#

ohh ok ok

#

got it

wraith grove
#

@carmine nexus Minecraft might do it automatically but you also might need to manually open the port in your firewall

#

press Windows key + r, then type wf.msc in the box and press enter

#

click into the inbound rules tab on the left, then click new rule on the right

#

then port on the first page, TCP and the port you want to allow on the next page, then you can click through the rest of it pretty much and give it a name on the very last page

slate pelican
#

looking for someone good in network programming, please send me a DM if interested.

wraith grove
#

why not just ask here

#

If your not paying, and you give no real information about it, why would anyone wanna dm you about it

slate pelican
#

ok, my fault. it's actually about a project i have and wanted it to be discrete

#

you mind if i send you a dm? @wraith grove

carmine nexus
#

then port on the first page, TCP and the port you want to allow on the next page, then you can click through the rest of it pretty much and give it a name on the very last page
@wraith grove Do I need to repeat the same process for the UDP port?

#

I did what you told me to do so know I am just confused is it opened or not lol.

wraith grove
#

You shouldn't need to, afaik minecraft uses tcp exclusively, at least for the desktop version

#

does it work now?

carmine nexus
#

Ok but the thing is I am trying to host web page ๐Ÿ˜‚ mc was just like an example. Anyways I ran into another problem ._.

#

Is it ok if I dm you? @wraith grove

wraith grove
#

I'd prefer if you didn't

#

What is the problem

carmine nexus
#

Ok I'll just send all here then.

#
import serial
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
import serial
import time
from http.server import BaseHTTPRequestHandler, HTTPServer
from flask import Flask

app = Flask(__name__)

class RequestHandler_httpd(BaseHTTPRequestHandler):

    def do_GET(self):
      ser = serial.Serial("/dev/ttyUSB0", 9600)
      getVal = ser.readline()
      value = str(getVal)[2:]
      print(value[:-5])
      messagetosend = bytes(str(value[:-5]),"utf")
      self.send_response(200)
      self.send_header('Content-Type', 'text/plain')
      self.send_header('Content-Length', len(messagetosend))
      self.end_headers()
      self.wfile.write(messagetosend)
      print(self.requestline)
      return    

@app.route("/")
def home():
    RequestHandler_httpd(BaseHTTPRequestHandler)
    server_address_httpd = ('192.168.1.10',8080)
    httpd = HTTPServer(server_address_httpd, RequestHandler_httpd)
    print('Server starting...')
    httpd.serve_forever()

    while True:
        RequestHandler_httpd.do_GET()

if __name__ == "__main__":
    app.run(debug=True, host="0.0.0.0", port=2222)```
#

so

wraith grove
#

put py after the backticks at the beginning

carmine nexus
#

My arduino reads the temp and by serial communication sends it to pc which then puts it up on the web

wraith grove
#

```py
code
```

#

ty

carmine nexus
#

anyways, I get this

#

Translated to web location cant be reached

wraith grove
#

well yeah you are trying to connect to 0.0.0.0

#

thats not a real IP

#

0.0.0.0 in your program just represents it will respond on any interface

#

its not what you are actually connecting to

carmine nexus
#

yeah but, it has to be that cuz then other ppl can remotely access it

wraith grove
#

well it doesn't have to be that

carmine nexus
#

basically my friend has the same this set for his web page and it works...

wraith grove
#

but regardless you connect using the IP of the computer running the server

carmine nexus
#

so I should change it right?

wraith grove
#

not in your script

#

Type the IP of the computer running the script in your address bar

#

the IP is what tells your computer where the website is

carmine nexus
#

you mean like my local ip or my like public ip

#

idk how to call those lmao

wraith grove
#

either one should work if you have portforwarding set up

#

local ip is normally how you test it at first

carmine nexus
#

this comes out

wraith grove
#

I told you not to change your script

#

You are getting an error because your computer doesn't have an interface with that IP, since it is on your local network

#

Revert your script, then do what I said

carmine nexus
#

ok I changed it back how it was ("0.0.0.0")

wraith grove
#

mhm

#

now try to go to 93.137.129.223:2222 in your browser

carmine nexus
#

why da hell do you know my ip

#

bruh you scary

wraith grove
#

lmao its in the error message

carmine nexus
#

crap

wraith grove
#

your IP isn't sensitive information

carmine nexus
#

still the location cant be reached

wraith grove
#

ok try its local IP

#

That probably means your port forwarding isn't correct

carmine nexus
wraith grove
#

well there ya go

#

it works, just your script is broken

carmine nexus
#

how tho

wraith grove
#

it tells you at the bottom of that error message

carmine nexus
#

I am noob at flask sry if I am annoying

wraith grove
#

RequestHandler_httpd(BaseHTTPRequestHandler) this line is incorrect

#

what do you expect it to do?

carmine nexus
#

so basicly whenever I connect to it it creates like the header with info about temp

#

basically it worked before without the flask but it was so dumb and impractical

wraith grove
#

Not sure what you mean

#

what do you expect that line specifically to do, not the whole script

carmine nexus
#

To be honest idk lol I found it on the internet, basically found this on someone's website

wraith grove
#

okay well jsut delete that line

#

it makes no sense

carmine nexus
#

ok but now all other stuff are not working

#

from the defined function

#

oh ok that's why I needed the class

wraith grove
#

What do you get when you visit the website

carmine nexus
#

you mean like now?

#

If you mean now, I cant access it.

wraith grove
#

uh why are you sending out the data out on usb with port 9600

#

oh wait I see what your doing lmao

#

silly me

carmine nexus
#

haha lol

wraith grove
#

So it loads but gives a blank page?

#

I think that would imply your input is doing something funky

#

so I would debug around that

carmine nexus
#

every time it said that the site cant be reached

hollow saddle
#

ip wrong?

wraith grove
#

At the same IP as the previous error page?

ember ledge
#

i have this error

Traceback (most recent call last):
  File "C:/Users/Mashiro/Desktop/projectsChallenge/DB/server.py", line 48, in <module>
    main()
  File "C:/Users/Mashiro/Desktop/projectsChallenge/DB/server.py", line 37, in main
    _client, _address = server.accept()
  File "C:\Users\Mashiro\AppData\Local\Programs\Python\Python38-32\lib\socket.py", line 292, in accept
    fd, addr = self._accept()
OSError: [WinError 10022] An invalid argument was supplied
file name = server.py

import socket
import threading
from tkinter import *
from tkinter import messagebox
import json
import pickle
import configparser

config = configparser.ConfigParser()
config.read('settings.ini')

_dataSize = 1024

HOST = "127.0.0.1"
PORT = 566


server = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
server.bind((HOST, PORT))


clients = []
dc_servers = {}



def recv_data(client):
    while True:
        data = client.recv(_dataSize)
        if data.decode() == "login":
            print("login data....") ## testing...



def main():
    while True:
        _client, _address = server.accept()
        clients.append(_client)

        print(f"[NEW CONNECTION] {_address} connected to the server.")

        recv_data_thread = threading.Thread(target=recv_data, args=(_client,))
        recv_data_thread.start()



if __name__ == "__main__":
    main()


what is the problem..?

carmine nexus
#

At the same IP as the previous error page?
@wraith grove yes

wraith grove
#

@ember ledge Decently sure you need admin rights to be able to host on ports <1024, might be wrong tho

#

try a higher port

#

Nothing gets printed from the script right @carmine nexus

carmine nexus
#

yup

wraith grove
#

have you tried rebooting the script

carmine nexus
#

yea

#

I did

ember ledge
#

@ember ledge Decently sure you need admin rights to be able to host on ports <1024, might be wrong tho
@wraith grove
no this is the ... like when i want to receive data

#

try a higher port
@wraith grove
i tried

wraith grove
#

same error?

ember ledge
#

yup

vestal surge
#

its c, addr = server.accept() not _server.accept() pretty aure that womt work

carmine nexus
wraith grove
#

oh so its working as expected

#

So your port forwarding is wrong

#

can you send me a screenshot of the rule

carmine nexus
#

so basicly the script would create a temporary website kinda and send <h3>data</h3>

wraith grove
#

yeah makes sense

#

oh thats what it used to display

#

not what it displays now

carmine nexus
#

yeees

#

because I want to be abled to access this site from anywhere

wraith grove
#

oh I know the problem

carmine nexus
#

and that's why I needed the port forwarding and thuss

#

stuff*

wraith grove
#

home() never gets called

#

Unless its something fancy about flask

#

lemme check

carmine nexus
#

I'll try setting it to Welcome

wraith grove
#

okay wait so it gets called every time you go to "/"

carmine nexus
#

and try running it and see what happens

wraith grove
#

you are def misunderstanding how to use flask

carmine nexus
#

look what I showed you that used to work was when there was NO FLASK CODE

wraith grove
#

its not the same as a httpserver from python

#

Yeah that makes more sense now

#

basically with flask you just return the stuff you want to appear on the page

#

so just return the data

gloomy root
#

Thats because its a WSGI interface

#

Hes using raw sockets from the looks

#

nvm wrong person

wraith grove
#
from flask import Flask
app = Flask(__name__)

@app.route('/')
def hello_world():
    return 'Hello, World!'
#

this is the example code from their docs

carmine nexus
#

bruh

#

I am so god damn stupid

#

I think I know how to make it work

#

wait a sec pls

wraith grove
#

yeah should be pretty easy to fix it now

gloomy root
#

Why are you making a http server on every request to that endpoint ๐Ÿค”

wraith grove
#

yeah I just pointed that out a little bit ago

gloomy root
#

That is a very insecure method

#

and they shouldnt be used in production or globally accessible sites

wraith grove
#

It's also why his website wasn't working

carmine nexus
#

bruh do I look like Bill Gate to you? ๐Ÿ˜‚

wraith grove
#

if you port forward, your website is globally accessible

carmine nexus
#

still some errors...

#

Ohhhhhhhh wait

#

It works!!!!

#

@wraith grove thanks for everything, including putting up with me.

wraith grove
#

np

carmine nexus
#

but still doesnt work if I dont access it from local ip ๐Ÿ˜ฆ

wraith grove
#

Send me a screenshot of your portforwarding rule

carmine nexus
#

Is this what you wanted?

gloomy root
#

your router

#

not your local fw

carmine nexus
#

and how do I do that

#

you mean like the thing on internet?

#

like 192.168.1.1. thing

gloomy root
#

go to your routers settings page

#

normally on some ip like that yeah

carmine nexus
#

yea but it doesnt work usually when I try to port forward there

gloomy root
#

i mean you have to if you want to expose it

carmine nexus
#

ok here it is

#

I mean that's it what I sent up there

gloomy root
#
Name: MyHttpServer
Protocol: Both
WAN Host Start Ip Address: 0.0.0.0
WAN Host End Ip Address: 255.255.255.254

WAN Connection: Internet_Ethernet

WAN Start Port: <server port>
WAN End Port: <server port>

Enable MAC mapping: un-ticked

LAN Host IP addres: 192.168.1.100

LAN Host Start Port: <server port>
LAN Host End Port: <server port>```
#

That should be what you need to portforward

#

tho im not 100% surte

carmine nexus
#

that's what it is bro

#

BRO

#

wait

#

I think it works

#

but I need someone to try accessing it

wraith grove
#

@carmine nexus If its that same public IP as before it doesn't work for me

#

is the LAN Host IP address the same as the local ip of the server

carmine nexus
#

I mean it didnt work for you cuz I turned the web site off

#

wait I'll turn it on so you can try accessing it

#

try accessing it and tell me if you see anything

wraith grove
#

yep works

carmine nexus
#

Thanks once again!

empty solstice
#

hey

#

can anybody help me with putting my public IP

#

cause I'm not able to make a website for WAN

#

it is only running on localhost

#

if anybody knows pls tell me

tall olive
#

i don't understand the question, can you try to phrase it differently?

empty solstice
#

ohk listen

#

I'm making a website

#

and I have used python for backend

#

and I have been testing it on local host 127.0.0.1

#

but when I tried to put it online

#

I set the host as my public IP

#

but it was still in the local host server

tall olive
#

still need more information

#

what are you using to serve your site

#

how did you specify the IP

empty solstice
#

??

#

I'm using sockets for my server and clients

#

in backend

tall olive
#

okay can you share the code for how you bind your sockets

ember bough
#

hello

empty solstice
#

okay can you share the code for how you bind your sockets
@tall olive well it is a whole F website

#

so may I DM?? you @tall olive

dusk mason
#

dumb question, so duno if i should use websockts or just POST , i need to update data aprox evry 5 seconds?

shy pebble
#

maybe event stream is what you want?

carmine nexus
#
@app.route("/")
def home():
        return render_template("main.html")```
#

Doesnt work for me

#

It says that the html file cant be found but its in the same directory as the py program. Any ideas?

tall olive
#

@empty solstice i think generally we like to solve problems in channels so others can learn from them or help. just wanna see the socket bind line

#

@carmine nexus i assum that's flask?

carmine nexus
#

Yeah, it is. Sorry I should've mentioned that.

tall olive
#

by default flask will look for your templates in a tempates directory

carmine nexus
#

Oh, okI didnt know that. I'll try that.

tall olive
carmine nexus
#

Ok thanks

#

Aight it works now, thanks again!

tall olive
#

no problem

carmine nexus
#

Also I have 1 more question.

#

When ever my site is opened, I want my flask apk to send a random value as a label on a specific position on the html file. How can I do that? Is it even possible with flask?

#

Basically I want to update value of html label from flask apk.

tall olive
#

@carmine nexus you want the value to be different on page refresh or to change without reloading the page?

carmine nexus
#

well I would prefer for it to change even if it's not refreshed

tall olive
#

you'll need to use javascript then

#

to query your api

carmine nexus
#

query my api?

#

query is a library or...?

tall olive
#

so you have two options with web development. server side rendering which you can do in many langauges, you're using flask for that. you can pass context into your templates with flask to do things dynamically on the server but ultimately you're just serving a rendered html page to the browser

you can also do things client side to update the page dynamically based on client inputs, time, etc. this would be done with JavaScript (or another client language that compiles to JavaScript). usually how this works is you could expose an api endpoint that serves something like json which is easily parsed by multiple languages as your'e sharing data between python and JavaScript. then you'd use ajax requests to fetch data from an API if you need to get some information, like your label to update and update the DOM directly via JavaScript

empty solstice
#

@empty solstice i think generally we like to solve problems in channels so others can learn from them or help. just wanna see the socket bind line
@tall olive OK I'll send the code in some time

carmine nexus
#

Ok and how could I make the value to be different on page refresh? @tall olive

tall olive
#

@carmine nexus do you know how to pass context to your template?

#

when you render your template you can pass in variables and then render those variables

carmine nexus
#

No. I am new to all of this...

#

Oh ok.

#

I'll try to find something about that. Thanks.

tall olive
#

should give you a lot of info

carmine nexus
#

Ok, thanks once again! Really appreciate your help. ๐Ÿ˜„

copper hearth
#

Hey, using scrapy with beautyful soup is silly?

tall olive
#

silly in what way?

#

they do different things

#

so it can make sense to use both

#

oh wait

#

i read that as scapy

copper hearth
#

yup, but when I browse net, they always compare which one to use..

tall olive
#

๐Ÿ˜„

copper hearth
#

I got spiders with scrapy, and then I use BS4 for easier extractions ๐Ÿ˜„

tall olive
#

seems find to me if neither are a superset of the other that you'd use both

copper hearth
#

welp

#

I just tried scraping with scrapy and its quite easy

carmine nexus
#

Who ever is connecting to my website from 35.196.132.85 please stop it...

open mulch
#

obvious bait?

tall olive
#

@carmine nexus it's possible you're just using an IP that used to be used for something else. also people just scan the web constantly to bogus requests.

#

you can add a firewall rule to block it if you want

vestal magnet
#

address belongs to google

tall olive
#

it's pretty common for some client to keep hitting an IP long after it stops being in use for its previously intended purpose... heh

carmine nexus
#

Aight then. Thanks.

ember ledge
#

@carmine nexus are you in Brazil

carmine nexus
#

No?

#

Why lol

ember ledge
#

shodan

carmine nexus
#

?

ember ledge
#

google shodan

#

it can be really help full

somber stream
#

I'm not sure this is a well-baked question, but I'm gonna ask it anyway: does socket.socket(socket.AF_INET).bind(('', port)) bind atomically, or is there a possibility of race conditions if multiple (potentially thousands) of instances of Python execute this at the same time

wraith grove
#

What would bind atomically mean here, its not a read-then-write operation

somber stream
#

I'm imagining a loop like:

port = 1024
sock = socket.socket(socket.AF_INET)
while True:
    try:
        sock.bind(('', port))
    except OSError:
        port += 1
        continue
    break

(this may not be the best way to structure this loop but hopefully the intent is clear)

#

and this will be running in thousands of instances on the same computer, and I want each instance to get its own port for communication

#

some context: this will be running on scientific high-performance computing clusters to manipulate and manage other more cpu-intensive calculations running on other "compute nodes" in the cluster

wraith grove
#

I am not sure what would happen if two threads tried to bind the same port at the same time, but rather than brute forcing a port, why don't you handle it in the startup of the scripts

#

e.g. pass a unique unused port number to each script

somber stream
#

the workflow doesn't really permit that approach

#

the scripts have a complex dependency between them which is managed by a separate project, Balsam, developed out of ALCF (Argonne labs) for peta- and exa-scale compute clusters

#

we have basically no way of knowing ahead of time how many total scripts will be running or the order/timing with which the scripts are executed

wraith grove
#

little bit less hacky of a solution

somber stream
#

ok, that's a cleaner solution. basically bind to port 0 and figure out the port number after the fact. thanks!

kindred basin
#

So Iโ€™m almost finished with my website fetcher designed to give the user a url based on input letโ€™s say the user types in google it will return https://google.com: the program will request the url to check to see if itโ€™s valid.

But some things Iโ€™ve read say thatโ€™s illegal. Is it illegal to make a website fetcher.

tall olive
#

i couldn't rely on people online to give you advice about whether something is legal or not. that's what lawyers are for :X

tropic steppe
#

If you're simply checking if an address resolves to a webserver, you don't need to actually "fetch" from the server.

empty solstice
#
HOST = 'localhost'
PORT = 6666
ADDR = (HOST, PORT)

# GLOBAL VARIABLES
persons = []
SERVER = socket(AF_INET, SOCK_STREAM)
SERVER.bind(ADDR)
#

well this is how I bind my server @tall olive that you asked
I put my public IP to try to make it available tho but IDK why it still runs on localhost

thorn stratus
#

It should run on localhost

empty solstice
#

TBH I'm not much good in this

#

why?

thorn stratus
#

Your computer is serving the website to any body who connects to your computer with port 80

#

Localhost just connects back to your own computer

empty solstice
#

yep

thorn stratus
#

It's just another connection on port 80

empty solstice
#

yeh but when I put my public IP into the HOST variable it still run's on localhost

#

yeh IK that bro

#

well ok

#

then just tell me

#

how not to run it on local host

#

?

thorn stratus
#

I mean it shouldn't run at all if you put your public IP as your host I'm pretty sure

#

Just put 0.0.0.0 as your host

empty solstice
#

well it doesn't

#

ok

#

wait I'm trying

thorn stratus
#

The host here just tells what the destination address has to be for it to be accepted

empty solstice
#

yeh ok

#

see this

#

it still shows that it is running on localhost

hexed epoch
#

that output looks like flask but the code does not look like flask

#

is the output from running a flask server?

tall olive
#

yeah, that output is not even the same port

#

if you're trying to change to host/port flask listens on you pass that to flask's app.run or environment

empty solstice
#

is the output from running a flask server?
@hexed epoch yep

#

if you're trying to change to host/port flask listens on you pass that to flask's app.run or environment
@tall olive ohk

#

thanks BTW I'll try

hexed epoch
#

the code isn't code for a flask server

empty solstice
#

WDYM?

hexed epoch
#

running:

export FLASK_RUN_PORT=6666

will switch your local dev flask port

empty solstice
#

ohhh

#

ok got it

hexed epoch
#

the code you pasted has nothing to do with flask

empty solstice
#

ok

hexed epoch
#

you're declaring a few variables, creating a socket, and binding an address to it

#

so the code and the terminal output aren't related really

empty solstice
#

yeh gary asked how I binded my server so I showed him

#

ohk lol

hexed epoch
#

ah, ok yeah that's not how you bind a flask server

empty solstice
#

ohk

#

well I'll complete the web first then try that

#

thanks

tall olive
#

yeah, that code has nothing to do with flask ๐Ÿ™‚

#

you never said you were using flask you said you were doing a socket server

empty solstice
#

ohk ohk

strong laurel
#

hey guys, im making a neural network, does anyone think they could help?

#

its pretty long though.

tall olive
#

i think that's a different kind of network than the intention of this channel ๐Ÿ˜„

severe halo
tall olive
#

@severe halo couple things:

first it's just a lot of code to be at the top level, some functions for organization would be nice. as for some feedback

it's a pretty basic protocol you have. The client kind of assumes it'll never get partial messages back from the server or that you'll never need to receive a message larger than 1024 bytes. probably find in this simple protocol for now but there's no guarantee you'll get all the bytes back in one recv but in practice in your environment you might not ever have a problem.

the server can only accept messages from one client at a time. if multiple clients try to connect they'll overflow the listen backlog. again, might be fine for your environment but something to consider when writing larger socket servers. you also have a superfluous pass on connection accept

you have functions referring to raspsocket which is defined in a __main__ gate so this code can't work as a library at all. you should pass raspsocket to your UI_Mainwindow constructor and store as an attribute vs accessing it globally.

#

not a bad attempt if you're new to sockets though

thorny locust
#

is there any coherent guide or reference for setting up nonstandard CA certificate bundles in such a way that python can find them with urllib and urllib3/requests, on linux?

severe halo
#

@tall olive Thank you so much! What do you mean with the first paragraph? I don't really understand๐Ÿ˜ฌ Anyway yeah, I didn't pay much attention to the reciving stuff because for now and I think also in the future I'll continue to send only that sort of index (which is "short"). Maybe in the future Maybe in the future I will want to allow more clients to connect, how should I do it? Just increase the backlog? About the IU you're right, I was quite approximate and I simply copied the qtdesigner code without going into it in depth. Huge thanks!

tall olive
#

@severe halo with tcp just because you send("foo") on one end doesn't guaranteed that recv(1024) will get "foo". it could get "fo" and a subsequent call could get "o"

#

with a streaming protocol you usually mark the end of your messages some how so you know when you've received a full message

#

but in practice on your home network you'll likely never see that happen

wraith grove
thorny locust
#

thanks! ill take a look

tall olive
#

@severe halo also if you want to work with multiple clients you'll want to move your handler into a thread or look into handling it with async code so you can have some code always ready to accept

#

a common pattern is to have your main thread just running accept in a loop and spinning off a thread to handle the client connection

wraith grove
#

oh wait you wanted a CA

thorny locust
#

no i think this is it

tall olive
#

at larger scale you'd look into async

wraith grove
#

oh okay

thorny locust
#

my company MITMs SSL connections

#

and it breaks everything: git, pip, conda (which uses requests/urllib3), requests/urllib3

#

they use a self-signed certificate to do so

wraith grove
#

oh so you just need to know how to trust them

thorny locust
#

yes

wraith grove
#

tbh that should be done with group policy or something similar

thorny locust
#

unfortunately i dont know where the certs have been installed on our machines

#

this is on linux

#

on windows its a lost cause

#

IT just doesnt care

#

but at least on our linux work machines id like to understand how it's supposed to work

wraith grove
#

Its kinda baffling to me that your IT doesn't make all the machines trust their own certificates

thorny locust
#

๐Ÿคทโ€โ™‚๏ธ

#

on windows for example i can connect to websites fine, so whatever the browsers use works

#

but python and git break

wraith grove
#

that is really strange

thorny locust
#

on linux, everything started breaking recently. these are SSH only on prem servers so i dont even know if they bothered to install the CA certs anywhere

#

everything breaks on the linux machines, even curl

wraith grove
#

oh does it just give you a warning on browsers

thorny locust
#

nope the web browsers on our windows machines work fine, no warnings or anything

#

again i dont really care about the windows case right now, because 1) i know it's complicated w/ AD and group policy, and 2) my team mostly works on the linux servers

#

i say "servers" but really are just big beefy computers sitting in an on-prem data center somewhere

wraith grove
#

Yeah I'm just curious on what is going on there

thorny locust
#

me too ๐Ÿ˜›

#

let me give you an example

#
% git clone https://github.com/gwerbin/scientific-colourmaps
Cloning into 'scientific-colourmaps'...
fatal: unable to access 'https://github.com/gwerbin/scientific-colourmaps/': Peer's certificate issuer has been marked as not trusted by the user.

this is actually a different error compared to what i used to get ๐Ÿค”

tall olive
#

maybe they have browser configs managed to use proxy rather than setting up a system CA blobrofl

wraith grove
#

You have the CA file right

thorny locust
#

no i have no idea where it would even be

#

that's part of the problem

#

i've asked repeatedly and i never get a response

#

and now pip install is magically working x_x

wraith grove
#

I'm pretty sure you would have to get it from your IT

thorny locust
#

im so confused

#

let me see if i can find it..

#

theres a bunch of stuff in /etc/pki

wraith grove
#

It might be in there, but if its not already trusted why do you think its on your machine at all

thorny locust
#

thats a good question and i was going to ask

#

it is possible that they didnt bother to put it on these machines at all right?

wraith grove
#

Yeah I would say thats the most probable

thorny locust
#

ugh

#

alright ill ask

#

in any case, how does this typically work?

#

a library like openssl would have to find the certificate used to self-sign?

wraith grove
#

I believe the CA is usually stored in /etc/pki/ca-trust/

#

so just looks in there for it

#

varies by distro

thorny locust
#

makes sense. it's been a little while since i read about all this. a "self-signed" certificate means that the certificate represents both the website and the custom/nonstandard CA itself?

wraith grove
#

It just means the certificate was signed by a CA that is only trusted in your organization

thorny locust
#

makes sense

#

but in order to trust it, i need the actual CA cert

#

which is either tucked away somewhere or just not available to me right now

dusk sparrow
#

hello , I have an issue of building psutils on my docker image for python 2.7
it fails every single time , and the image Im trying to build is ubuntu 20.04

#
  Building wheel for psutil (setup.py): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python2.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-UhM3mw/psutil/setup.py'"'"'; __file__='"'"'/tmp/pip-install-UhM3mw/psutil/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-Cqscj2``` this is the backtrace
tall olive
#

is there more?

dusk sparrow
#

yes @tall olive

tall olive
#

would need to see more off the error.

dusk sparrow
#
         cwd: /tmp/pip-install-UhM3mw/psutil/
    Complete output (45 lines):
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psbsd.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_compat.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_pswindows.py -> build/lib.linux-x86_64-2.7/psutil
#
    copying psutil/_psosx.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_common.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psposix.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_pssunos.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/_psaix.py -> build/lib.linux-x86_64-2.7/psutil
    copying psutil/__init__.py -> build/lib.linux-x86_64-2.7/psutil
    creating build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_misc.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_connections.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_posix.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_windows.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_sunos.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_linux.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_bsd.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/runner.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_unicode.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/__init__.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_process.py -> build/lib.linux-x86_64-2.7/psutil/tests```
#
    copying psutil/tests/test_aix.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/__main__.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_memleaks.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_testutils.py -> build/lib.linux-x86_64-2.7/psutil/tests
    copying psutil/tests/test_contracts.py -> build/lib.linux-x86_64-2.7/psutil/tests
    running build_ext
    building 'psutil._psutil_linux' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/psutil
    x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fdebug-prefix-map=/build/python2.7-1x6jhf/python2.7-2.7.18~rc1=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC -DPSUTIL_POSIX=1 -DPSUTIL_SIZEOF_PID_T=4 -DPSUTIL_VERSION=572 -DPSUTIL_LINUX=1 -I/usr/include/python2.7 -c psutil/_psutil_common.c -o build/temp.linux-x86_64-2.7/psutil/_psutil_common.o
    psutil/_psutil_common.c:9:10: fatal error: Python.h: No such file or directory
        9 | #include <Python.h>
          |          ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
tall olive
#

you need python-dev installed

#

@dusk sparrow ^

#

what OS are you on

dusk sparrow
#

guest or container?

tall olive
#

where you're running that install

dusk sparrow
#

ubuntu 20.04

#

u mean the image right @tall olive?

#

you need python-dev installed
ohh

severe halo
#

@tall olive oh OK, how is usually marked the end of the message? And ipotetically speaking, if the client doesn't receive the complete message, what happens? The client have to re-request the information? Also, do you know an OS program that uses socket in an optimal way from which I can take inspiration for the multi-client multi-threaded or asynchronous programmed stuff?

tall olive
#

@dusk sparrow you probably just need to apt install python-dev then

dusk sparrow
#

you need python-dev installed
@tall olive so python2.7-dev would do?

#

@dusk sparrow you probably just need to apt install python-dev then
@tall olive alright thank u so much

tall olive
#

python2.7 cryman

dusk sparrow
#

thank u so much @tall olive for the quick reply and a solution , much appreciated

tall olive
#

no worries ๐Ÿ™‚

#

lemme know if it keeps failing

dusk sparrow
#

yes it works

#

thank u once again!

#
  Building wheel for psutil (setup.py): finished with status 'done'
tall olive
#

@severe halo that's up to your protocol on how you mark the end of a message. nothing to do with tcp

#

if you don't get a complete message you just buffer and keep requesting

#

most people these days just use http as it handles most of this for you over raw tcp

#

i don't know any easily digestible examples off the top of my head

#

Within data communication protocols, TLV (type-length-value or tag-length-value) is an encoding scheme used for optional information element in a certain protocol.
The type and length are fixed in size (typically 1-4 bytes), and the value field is of variable size. These field...

#

other protocols use new lines as a delimiter

#

there are a lot of options

visual sedge
#

if someone would help me to do a chat server using only python and so anyone could get on it even if they are not connected to my router, please if so DM me

severe halo
#

OK it makes sense

#

Thank you again @tall olive !

tall olive
#

@visual sedge i prefer to help in chat so others can join or pick up if i have to run and others can learn from the discussion. do you have specific questions about what you're stuck on?

visual sedge
#

ok if you help it'll be great anyway

#

and i don't have any specific question really but i can show you what i got and you could help me do it as a want to

#

do you want me to put the code here?

#

what i've tried is basically a chat server but in my own computer using port 9999 so i don't get any interference

#

i think it works but only in my own computer and i wanted so anybody could get in

#

although is 3 code, what i mean is that i have one code file for the client, other file for me and the other as the server itself

#

that's why i said to do it on dm so i don't disturb with all that code

#

@tall olive

tall olive
#

is the code not working like you expect in some way?

visual sedge
#

yes

tall olive
#

you can put the code in a paste bin

#

or show errors with relevent code

visual sedge
#

what is that?

tall olive
#

!paste

errant bayBOT
#

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.pydis.com/

After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.

visual sedge
#

i can translate the code to HTML but you could see my ip adress

#

i'm going to try the ! paste instead

#

but @tall olive i used daemons is that a problem?

tall olive
#

no

visual sedge
#

@tall olive this is the server

#

you'll notice some things in spanish

#

that's normal since i sometimes do it like that

#

so i don't get confussed

#

@tall olive what do you think

tall olive
#

you didn't link anything

visual sedge
#

oh my bad lol

tall olive
#

also you haven't said what doesn't work about it

#

does it error or just not work how you expect?

vernal surge
#

i think the problem is that he doesn't want to host it on his own PC (and i don't blame him lol)

visual sedge
#

it does work but i just wanted to be so anybody could get in it and not like it is know

#

@vernal surge exactly

vernal surge
#

so first things first, don't bind to localhost on line 54

#

localhost will not allow any other machine to connect

visual sedge
#

i know but what host do i use

#

localhost is the only i know

vernal surge
#

localhost is typically a DNS name to 127.0.0.1 which is a local loopback and purposefully block external packets

tall olive
#

you can use 0.0.0.0 to bind to all interfaces

vernal surge
#

do one of two things, bind it to an actual IP address, or use 0.0.0.0

#

0.0.0.0 is preferred, that way the code is portable

#

0.0.0.0 = any ip address i'm listening on

visual sedge
#

if i use 0.0.0.0 do i have to change the client and other client code?

#

let me show you them first

vernal surge
#

probably not, i've not seen the client lol

#

unless you are statically connecting to localhost

tall olive
#

if you bind on 0.0.0.0 connections to localhost still work

vernal surge
#

but they wont if he distributes that client code ๐Ÿ˜„

tall olive
#

๐Ÿ˜„

visual sedge
tall olive
#

okay, if they're on different computers, no, it won't still work blobrofl

vernal surge
#

ah yeah, see you are hardcoding localhost in the client

tall olive
#

that just looks like the server with some stuff commented out

#

ignore me, that syntax highlighting is weird

vernal surge
#

lololol

#

yeah, i saw no #s

tall olive
#

oh no, oyu have an unescaped "

vernal surge
#

or """s

visual sedge
tall olive
#

made everything look commented out at the end ๐Ÿ˜„

vernal surge
#

why two clients?

#

are they not the same thing?

#

oh, i see, you are mocking out two users

#

that is a little hard to scale ๐Ÿ˜„

visual sedge
#

i know i forgot a " and i din't put a single # but i was rushing to copy and paste and the " missed out and the #s i just didn't pu them tbh LOL

#

@vernal surge i wrote code for both users so they can exchange the messages

#

i don't know other way LOL

vernal surge
#

anyway, you need to find a server to run your code (after you change it to a 0.0.0.0 binding) ... so the way you are doing it would require a VM because you are threading

visual sedge
#

i use the cmd

#

but i feel like that is not what i need tbh

vernal surge
#

you ought to probably try running your server in a container first

#

and then run client against it

#

that will show you more of what you are wnating

#

and if it works, containers are easier to deploy

visual sedge
#

that is what i did on my own computer isn't it

vernal surge
#

i haven't seen a dockerfile so i have no idea

visual sedge
#

i opened the cmd on my pc 3 times, so then one was the server itself, the other 2 were the clients

vernal surge
#

nope, that isn't a container

visual sedge
#

isn't that it?

vernal surge
#

google docker

visual sedge
#

what do you mean exactly?

#

google?? is that HTML or something

vernal surge
visual sedge
#

wow i didn't think this would be that hard ๐Ÿ˜… and i thought doing a calculator with username and password in order to use it on visual interface was hard

vernal surge
#

when you start doing client/server applications, the complexity is exponential

visual sedge
#

i see

tall olive
#

you don't need a container. once you're listening on 0.0.0.0 if you want people to connect to your home computer you'll need to setup port forwarding on your router but that's pretty sketchy

#

you'd wanna look at some kind of hosting provider

vernal surge
#

he doesn't want them to connect to his computer

#

but in lue of teaching actual daemonization (e.g. systemd or something), plus firewalling, plus networking ... docker is a bit easier lol

tall olive
#

i read it as they wanted people to get in, not that they didn't want them to connect to home computer

i think it works but only in my own computer and i wanted so anybody could get in

visual sedge
#

but docker is like a python capsule or something?

tall olive
#

but i can understand not wanting that ๐Ÿ˜„

vernal surge
#

docker is like an all things container lol

#

i use it for almost everything these days ... so i am a little biased

visual sedge
#

i see

#

do i have to use any html for that

vernal surge
#

with the exception of true system apps

visual sedge
#

wait what if i convert the code to a executable file(.exe) but then, what server could i use?

vernal surge
#

i wouldn't do that, because then you are stuck with running it on windows... and those VMs are more expensive lol

#

python is nice and portable

visual sedge
#

but someone would have to have python to use the server then

vernal surge
#

not with docker ๐Ÿ˜„

visual sedge
#

ohhh i seee

vernal surge
#

although you would need docker... lol

visual sedge
#

so it's basically like a on-line code executor isn't it

#

but docker is not free is it

vernal surge
#

docker is free

visual sedge
#

and how do i apply docker to my code

vernal surge
#

you don't, you have docker RUN your code

visual sedge
#

ohhhh

#

i see

#

okay okay okay but what about the server itself

vernal surge
#

you need to pick a host ... sign up for AWS, they have a fair number of free-teir services

visual sedge
#

okay i will check it out

#

thanks a lot man

#

to both you @vernal surge and @tall olive

#

i will tell you all when i investigate on that

#

thanks

tall olive
#

good luck!

#

there's a ton to learn in this space

#

writing and deploying networked applications is a big scope

#

so feeling overwhelmed is definitely normal

vernal surge
#

Yeah, is still overwhelming for me at times and I've been doing it for years lol

#

Although, the overwhelming bits are different now

tall olive
#

always changing ๐Ÿ˜„

#

never allowed to rest on your laurels

ember ledge
#

Does sendall work on UDP sockets? (Im using the standard socket library)

thorn stratus
#

I see no reason why it wouldnt

ember ledge
#

ok

#
header_bytes, c_address = self._socket_udp.recvfrom(self._header_size)
OSError: [WinError 10022] An invalid argument was supplied
#

Im not really sure what im doing wrong here

#
self._socket_udp = socket.socket(
    socket.AF_INET, socket.SOCK_DGRAM
)