#networks

1 messages · Page 8 of 1

jovial gate
#

Currently this layer uses guess_payload_class to enumerate all the different types of payloads it can carry, with each being it's own layer (ADU vs PDU)

#

But I'm trying to get multiple copies of the layer to get read, so I'd like to convert it to using

#

packetfield instead. Having a little bit of trouble figuring out how that messes up the building functions though.

jovial gate
#

Actually it messes with a ton of stuff. Ugh. Back to the drawing board.

flint nexus
#

Library == module, no?

coarse summit
jovial gate
#

Now at the point where I have Scapy correctly dissecting the packet. Yay!

#

Sadly, it still shows several layers, all as children of each other, instead of as siblings.

#

Can anybody give me a clue on making these layers siblings instead of parent/child?

#

All I can think of is making another layer that is an empty excepting a packetlistfield object

empty jacinth
#

Hey im getting an error when trying to have a client interact with a server, can someone ping if they are able to help?

ember ledge
#

Just ask your question, not asking and waiting for someone to answer to ask your question is wasting time

nova sequoia
#

any tips?

coarse summit
real badger
#

Hello,
I am having a very hard to understand issue with network authentication: I have a python 3.10 + python-behave project that is essentially a network client to test several https server back ends. I use requests to implement all the communication (not sure of the version, the one that comes by default with ubuntu 22.04). A normal run of the code might have a few thousand requests. The issue I am experiencing is that every 20 or so runs a random request might get stuck on a function on ssl.py. I have seen 5 cases so far, 4 of them on do_handshake() and one on read(). I can provide stack traces created from py-spy. I have also ps-ed during the issue and i can see that there are many idle python threads. Googling this issue gives me very few results and the ones I get are old. The most recent is this one: https://github.com/openssl/openssl/issues/19066 . If this answer has anything to do with my issue, it would imply that somewhere in my module stack some python code is using openssl from several threads at the same time and deadlocking.

Has anyone seen this issue? Any insights? Let me know if there is any more info I should provide.
Thanks

GitHub

Discovered while attempting to make PyMongo fork() safe (see PYTHON-3406). OpenSSL 3.0.5 can deadlock in SSL_do_handshake after fork() in a multithreaded process. Scenario: Process is running multi...

edgy pelican
#

SEND COOOODEEEEEE

real badger
# edgy pelican SEND COOOODEEEEEE

sorry is this to me? I am not sure what part of the project is relevant to share. I can't share it all because it's proprietary code and as far as I know my calls to request.post are rather normal:

import requests
import json
from requests.packages.urllib3.util.retry import Retry
session = requests.Session()
session.verify = False
retries = Retry(total=5, backoff_factor=1)
session.mount("https://", HTTPAdapter(max_retries=retries))
url = "my.server.domain"
user = test_user
res = session.post(url + "/login", data=json.dumps({"user": user}))

There is no call stranger than that. Besides I believe what is causing the issue is some poor code in behve, requests or ssl python modules, which won't benefit from any code I share, hence why I didn't do it. Happy to be proven wrong tho

edgy pelican
#

like, the threaded part

#

you should probably use async instead :P

real badger
#

I don't implement threads. All the code me or my team have created is single threaded. Any multithreaded behaviour must come from one of the modules I use, probably behave

edgy pelican
#

send stack traces

real badger
#

do_handshake example stack trace

#

read example stack trace

ember ledge
#

how i can make a requests with a proxy list like proxy.txt ?

ember ledge
jovial gate
#

For anybody who was following my Scapy journey: I added another layer that implemented absolutely nothing except PacketFieldList, and with proper extract_padding implementations it is working properly.

#

Now I just have to add a guess_payload_class somehow into the PacketFieldList and I'm golden.

proper viper
#

hi

grand kayak
#

this channel is about computer networking, not social networking

fallen turtle
#

My bad

topaz drum
random cobalt
edgy pelican
#

you'd be unlikely to find help here

random cobalt
#

😦

grave lily
#

Suggestion: whatever you do, make it an async library. That makes it easier for caller apps to integrate into their event loops.

steady junco
#

How to scale load balancers?
For example, say service A has lots of nodes and they make requests to Service C which also has lots of nodes via Load balancer B. As the requests increase, a single load balancer will no longer be sufficient. So how do we add more load balancers? Usually load balancers are the devices that split traffic. In this case, who can split traffic between load balancers?
Thanks in advance.
PS: I hope this is the right channel for this question

crystal current
# steady junco How to scale load balancers? For example, say service A has lots of nodes and t...

I googled it for you. You either need a bigger load balancer or you need a different approach like round-robin DNS. https://serverfault.com/questions/268597/what-is-a-typical-method-to-scale-out-a-software-load-balancer

harsh temple
#

is there anywhere to see a comprehensive list of ALL possible socket connection errors and what situations they occur in/what exactly they mean? i tried writing my code based on the manpage here https://man7.org/linux/man-pages/man2/connect.2.html but just now had a crash with a ECONNABORTED during connect which wasnt mentioned :/

grand kayak
#

although a bit outdated lol

harsh temple
#

like any other ones that the manpage doesn't mention

cedar forum
#

but like... this is probably not the way to go about it

#

catch the obvious ones and add a generic case to handle any you haven't caught

#

if they become so recurrent you need special handling, then add a new clause before your general one

harsh temple
#

as of now i've encountered these:

if platform.system() == 'Linux':
    RETRY = (115, 114, 11,) # EINPROGRESS, EALREADY, EAGAIN
    RETRY_HARDER = (110,) # ETIMEDOUT
    FAILED = (111, 103,) # ECONNREFUSED, ECONNABORTED
    SUCCESS = (106,) # EISCONN
elif platform.system() == 'Windows':
    RETRY = (10035,) # WSAEWOULDBLOCK
    RETRY_HARDER = ()
    FAILED = (1022,) # WSAEINVAL
    SUCCESS = (10056,) # WSAEISCONN
#

one other issue is that EAGAIN seems to mean multiple things and i havent been able to figure out how to discern extra context via select/connect_ex.

#

sometimes retrying after an EAGAIN works and other times it hangs 🤷‍♂️

grand kayak
#

@stark spear, welcome to our community.
This channel is about computer networking, and not social networking. I hope you can find better help in #1035199133436354600.
If you ever have any questions regarding computer networks, feel free to ask over here.

stark spear
#

oh i see

#

got it, thank u sir

pliant solstice
#

i made a python socketserver ```py
import asyncio
import websockets

async def echo_server(websocket, path):
try:
await websocket.send("connected to server: ready for echo")

    async for message in websocket:
        try:
            print(f"Received message from client: {message}")
            # Process the received message here
            await websocket.send(f"Received: {message}")
            print(f"Sent response to client: Received: {message}")
        except Exception as e:
            print(f"Error processing message: {e}")
except websockets.ConnectionClosedError:
    print("Client disconnected.")

start_server = websockets.serve(echo_server, "0.0.0.0", 8765)

asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
and i want to connect a computer from cc:tweaked computercraft to it with the following code written in lualua
local ws = assert(http.websocket("ws://myip:8765"))
print(ws.receive()) -- receive welcome
sleep(2)
ws.send("Hello!") -- Send a message
print(ws.receive()) -- And receive the reply
ws.close()```

#

i used this code with a public echo server and it works

#

but when i hook it up to my own server i can only send messages from server to client

#

i can not send anything from client to server

#

i tested both client and server and they work independently

#

what am i doing wrong?

bold wyvern
#

whats the best way to learn how to make a private network system in python? i need to learn how to make one for my A level project but dont know where to start...

split dust
#

What are the main frameworks for networking? Paramiko, Netmiko as the extesion of paramiko and something else worth learning?

steady horizon
split dust
#

I mainly use networking for Routers and interacting with them. I want to start using SNMP functions as well.
The big issue is that i want to start automating a huge ammount of routers and L3 switches (probably way more than 50k).
My idea atm is to create a DB with daily backups and SNMP readings but for a small population of routers and then expand

forest patrol
#

@vestal scroll i like your profile pic , nice duck

ember ledge
grand kayak
viral plaza
#

hmm well I am able to connect to my home network via my phone ,but im not able to do the same with the pc, there are too many networks near me , and it does not show networks after a certain number of them. its not even showing network of my mobile hotspot

#

help

edgy pelican
#

wrong discord server

#

please read description

celest fern
#

What kind of netwokring is thsi?

#

seemskinda lame tho\

edgy pelican
#

can we just talk about how tls is kinda scuffed tho

#

CAs signing CAs signing CAs signing-

#

do you guys have any better way to communicate securely?

#

you could have a secure conneciton with passwords or smth

#

but

zealous flint
wispy panther
#

The nsa

zealous flint
#

That sounds right

zealous flint
#

Don't think so. IPv6 has it's own special address for listening on all interfaces

#

Don't remember what it is off the top of my head

oblique wharf
gloomy root
#

yes

steep solstice
#

When I send an outbound TCP request to a server and on Wireshark, it showed to be Connection Reset [RST, ACK]. Is it issue on my side or issue on server side?

red crow
#

How can i bypass this or log out in everywhere where ever it is logged in or have the session data or cookie related to this account. I am trying to login my student account for the exam comming up but i can't log in and says this. Last time I log in to this account in a computer shop in the last exam which is 6 months ago. I don't know why they keep a session data expiry that so long or cookie. How can i solve this from my side? I think the shop I last time logged in they don't do this often so probaly they have not log in any other account for this site after me (my guess). Also last time i forgot the password for the account and the site did not have a forgot password option. So I went to college and and tell them that i have forgot the password then they give me the password that is save in raw.
(Do you think this is a poor practice and design for a website?)
How can I login in my account again?

crystal current
red crow
crystal current
jovial gate
#

My Google is weak today. Does anybody know of an application that actually uses the urgent flag/pointer in TCP?

long gazelle
#

Good day guys!!

Please can anyone help me on how host my twisted project so that my users can send and receive bytes to each other.

I am using digitalocean

Thanks in advance

#

Please guys help me I needed this

coarse summit
long gazelle
# coarse summit what do you need help with exactly?

I have a python twisted code that uses Datagramprotocol to send and receive bytes from one user to another but it's locally how can this go in production mode I am using digitalocean as a server deployment company

coarse summit
#

do you know how to host something?

long gazelle
coarse summit
long gazelle
steady horizon
#

Is your networking system peer-to-peer or server-client?

#

Usually it's always server-client to some degree, so you host the server program and ship client programs

steady horizon
#

Then you don't need to host any server

#

Keep in mind that if a consumer wants to communicate with another consumer somewhere else around the world, they need to set up port forwarding

jolly idol
grim timber
#

what is this server

uneven sequoia
#

🙋 Looking for a study buddy to dive into Machine Learning with!
⏰ Ideal if you're in or around my timezone (UTC +2).
🧠 Should have some familiarity with:
RNN (Recurrent Neural Networks)
LSTM (Long Short-Term Memory)
🌲 Regression Trees
Feel free to reach out if you're interested!

ember ledge
edgy pelican
ember ledge
#

hi

#

why would someone make a website using http requests instead of https?

edgy pelican
#

alr

#

so

ember ledge
#

budget? is it harder?

edgy pelican
#

essentially,

#

HTTPs is just HTTP over TLS

#

what you're asking is why would someone create a connection without TLS

#

(TLS is the shit they use to secure connections)

#

anyways so

ember ledge
#

tls is transfer layer security righ?

edgy pelican
#

yup

#

anyways so

#

an overview of how TLS works is

#

(oh god i need to explain a lot of shit)

#

firstly

#

we have a symmetric cipher

ember ledge
#

oh lòrd 😭

edgy pelican
#

basically, 1 key to decrypt and encrypt

ember ledge
#

alright

edgy pelican
#

S = symmetric cipher
S(key, plaintext) = ciphertext
S(key, ciphertext) = plaintext

#

secondly

ember ledge
#

yup

edgy pelican
#

you have a "key exchange algorithm"

#

what it does is

#

the client needs to send a "public key" to the server, and vice versa

#

what both sides do, is use it to create a "shared key" for the symmetric cipher

#

no not that

ember ledge
#

was that pgp?

edgy pelican
#

https://en.wikipedia.org/wiki/Diffie–Hellman_key_exchange

its usually elliptic-curve diffie-hellman, but same concept

Diffie–Hellman key exchange is a mathematical method of securely exchanging cryptographic keys over a public channel and was one of the first public-key protocols as conceived by Ralph Merkle and named after Whitfield Diffie and Martin Hellman. DH is one of the earliest practical examples of public key exchange implemented within the field of cr...

#

anyway

#

the issue is

#

someone could sit in the middle

#

and create a connection with both the client and the server and decrypt and re-encrypt all the msgs and read them

#

so

#

you need a digital certificat

#

heres the real hard bit

#

so

#

gotta eat dinner

ember ledge
#

oh

#

okay :c

edgy pelican
#

@ember ledge back

ember ledge
#

i thought you bailed on me @edgy pelican

edgy pelican
#

i had to eat dinner

#

it was 7:45 here

#

anyways

#

the good part

#

so now, the server needs to use a certificate

#

essentially it works like this

sign(private_key, data) -> stuff
open(public_key, stuff) -> data

#

the sign just signs the data, and you can re-"open" it with the public key

#

it ensures authenticity/integrity

ember ledge
#

this is like ssh keys

edgy pelican
#

yeah essentially

#

the problem is

#

you dont know if those keys are actually from the server or not

#

which is big sad

ember ledge
#

oh

edgy pelican
#

what you need is a CA

#

(certificate authority)

#

a CA has their own certificate public & private key

#

what they do, is the CA uses their private key to sign the server's public key

ember ledge
#

how do you know that the certificate is from the server

edgy pelican
#

very cool

#

problem solved

#

next problem: how do we know if the CA hasn't been hacked

ember ledge
#

yeah

edgy pelican
#

which is big sad

#

what happens next

#

is another CA uses their private key to sign the other CA's public key

#

now how do we know THAT hasn't been hacked

#

we get another CA

#

and so on

ember ledge
#

is this a joke 😭

edgy pelican
#

no this is actually how modern communication works

ember ledge
#

so you keep signing it... forever?

edgy pelican
#

its kinda funny

edgy pelican
#

you can't go on forever

#

you need to have someone at the top that you can trust

ember ledge
#

my ISP?

edgy pelican
#

@ember ledge you can actually see this

edgy pelican
ember ledge
#

the DNS?

edgy pelican
#

there's like 3 top CAs

#

if they get hacked, the entire internet essentially crumbles

ember ledge
#

i hope that happens

#

would be funni

#

so is that what https is?

edgy pelican
#

that's TLS

#

HTTPs is just transmitting data using TLS

ember ledge
#

i understand now

edgy pelican
#

http isnt even complicated

ember ledge
#

i read some http requests using wireshark once haha

edgy pelican
#

its not like its public info or anything

ember ledge
#

wym ;-;

edgy pelican
#

anyway, you can actually see the certificate chain

ember ledge
#

using wireshark?

edgy pelican
#

no

#

what OS are you on?

ember ledge
#

linux

edgy pelican
#

cools

#

anyway

#

fire up your terminal

#

and run openssl s_client -showcerts -connect discord.com:443

ember ledge
#

im scared

edgy pelican
#

it'll show a whole fuck ton of info about it

#

only part you want is the one under Certificate chain

ember ledge
#

whats ssl

edgy pelican
#

!d ssl

errant bayBOT
#
ssl

Source code: Lib/ssl.py

This module provides access to Transport Layer Security (often known as “Secure Sockets Layer”) encryption and peer authentication facilities for network sockets, both client-side and server-side. This module uses the OpenSSL library. It is available on all modern Unix systems, Windows, macOS, and probably additional platforms, as long as OpenSSL is installed on that platform.

Note

Some behavior may be platform dependent, since calls are made to the operating system socket APIs. The installed version of OpenSSL may also cause variations in behavior. For example, TLSv1.3 with OpenSSL version 1.1.1.

edgy pelican
#

read like, the first paragraph

ember ledge
#

thank you

edgy pelican
ember ledge
#

what about the 443

edgy pelican
#

the domain port

#

443 is the default HTTPs port

ember ledge
#

ohhh i see

edgy pelican
#

80 is plain ol' http

#

anyway you can see the cert chain is quite short

ember ledge
#

uhm... can i ask smth?

edgy pelican
#

what

ember ledge
#

whats a port 😭

#

i always forget

#

sorry

edgy pelican
#

In computer networking, a port or port number is a number assigned to uniquely identify a connection endpoint and to direct data to a specific service. At the software level, within an operating system, a port is a logical construct that identifies a specific process or a type of network service. A port at the software level is identified for each transport protocol and address combination by the port number assigned to it. The most common transport protocols that use port numbers are the Transmission Control Protocol (TCP) and the User Datagram Protocol (UDP); those port numbers are 16-bit unsigned numbers.

ember ledge
#

a connection ENDpoint

#

so like

edgy pelican
#

basically only for the server

ember ledge
#

well what if my phone is a server?

edgy pelican
#

then you need to open up a port on your network for anyone to connect to it outside your network

#

(network as in LAN)

ember ledge
#

i understand

#

this was surprisingly informative

edgy pelican
#

✨ information ✨

ember ledge
#

thank you <3

edgy pelican
#

anyways you can see the cert chain

#

the discord one is shockingly short

#

the bottom one (the server cert) is a cloudflare certificate

 0 s:C = US, ST = California, L = San Francisco, O = "Cloudflare, Inc.", CN = sni.cloudflaressl.com
   i:C = US, O = "Cloudflare, Inc.", CN = Cloudflare Inc ECC CA-3
   a:PKEY: id-ecPublicKey, 256 (bit); sigalg: ecdsa-with-SHA256
   v:NotBefore: Nov 19 00:00:00 2022 GMT; NotAfter: Nov 19 23:59:59 2023 GMT```

the top one is also a cloudflare certificate
``` 1 s:C = US, O = "Cloudflare, Inc.", CN = Cloudflare Inc ECC CA-3
   i:C = IE, O = Baltimore, OU = CyberTrust, CN = Baltimore CyberTrust Root
   a:PKEY: id-ecPublicKey, 256 (bit); sigalg: RSA-SHA256
   v:NotBefore: Jan 27 12:48:08 2020 GMT; NotAfter: Dec 31 23:59:59 2024 GMT```
#

theres 2 of them

#

which is very little

#

3

#

and all of them are google certs, even the top one

ember ledge
#

i think you exposed where you live...

edgy pelican
#

i dont think i did

ember ledge
#

baltimore... im coming

edgy pelican
#

you dont need "local CAs"

#

i live in asia

ember ledge
#

oh lol

storm cove
ember ledge
hushed pecan
#

Anyone who is into web crawling with python?

ember ledge
#

Maybe

coarse summit
#

<@&831776746206265384>

#

he sent it to more channels

long gazelle
#

Guys why is this happening

self.transport.write in python twisted says Nonetype has no attribute write

ember ledge
#

self.transport is None

long gazelle
#

How can it be None when the class of Datagramprotocol is up and running

ember ledge
#

Don't know, I just know it's None as the error says

#

Don't have a crystal ball to guess your code or get some logs either

ember ledge
#

Yeah sometimes it could be useful KEK

bold wyvern
#

I am just starting network and i was wondering if anybody has any guides or recommendations on how to use python sockets or if i should use something else for my project(a multiplayer card game for 4 people)

steady horizon
#

That is if you want to use socket sockets. Python has a higher level networking interface in the asyncio library and it's asynchronous, but you would have to turn your program into an async/await program

bold wyvern
steady horizon
#

If you still want to use socket sockets, you can use those for the clients and a socketserver socket for the server

steady horizon
#

You probably don't need a client socket to be asynchronous as each client is going to be using one socket at a time with a game server probably (you wouldn't be playing multiple games at once)

#

So you can just use socket for the client sockets. Just make sure they are set to not block and use selectors to get the client connection communicating right

sturdy vine
#

!resources

errant bayBOT
#
Resources

The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.

edgy pelican
#

#bot-commands

sand ridge
#

Anyone here that can give me code for simple quic implementation using aioquic library

#

A simple client server would work

#

Or some link to a working example

sand ridge
#

I would also appreciate any alternative libraries that have good documentation for implementing quic

bold wyvern
steady horizon
umbral kiln
#

Hii
I have setup an flask application in my local system which is having post endpoint to get the request
Now I want to make it accessible through internet while flask app run on my system
Is that possible?

silver crater
crystal current
silver crater
#

Best tip I can give you is rent a small cloud instance (from for example Hetzner or some other similar provider). Not very expensive and makes life easy

golden tartan
#

Hey

signal raven
#

Any Django devs here

steady horizon
solar badge
#

Hi all, I am using flask and I would like to retreive the form data. I am sending the form data through a react web. However, I keep getting empty request.form in flask..

    print(request.form)
    username = request.form.get('username')
    password = request.form.get('password')

In case you need the react code:

export const POST = async (formData: FormData) => {
    const url = "http://127.0.0.1:5000/login"
    try {

        const response = await fetch(url, {
            method: "POST",
            body: formData,
        })
        const data = await response
        return data
        return NextResponse.json(data)
    }catch(error) {
        console.log("FAILED")
        console.log(error)
        return NextResponse.json({message: error})
    }
}
pearl anchor
#

im having some difficulty understanding how dhts work and how do they function as a look up. i understand each dht implimentation varies and dependant on requirements but generally, how does a mdns dht become reachable. if im writting a p2p software that tries to connect to a mesh net, how can i let other devices on the same network independantly find the nearest peer.

ember ledge
#

Hi, for video app like youtube is SSE good or Websockets? connection will be one directional i just wanna user receive video blop.It looks SSE is generally good for mono directional but looks so expensive for me

flint nexus
#

hi! i'm writing a tcp listening server that should accept several simultanous incoming connections and then data from each of these connections should be output together in a single outgoing tcp stream. this is trivial, with queues and all that to communicate between the different threads, or even by using async, but the problem i have is regarding garbage collection. there could be quite a bit of backpressure here, so a lot of data could be queued up in the memory where this server is running and i want to make sure that this is not bloated over time. the only way i have figured that i can safely clean up is by running this in a separate process and then terminate it once it's done.

flint nexus
#

yup

#

but i have fixed this by inserting a header when sending out the data at the sender side

flint nexus
#

the logic for all this is created, the only problem i'm left with is the garbage collection

#

receiver is not able to receive data quickly enough, so it will build up a buffer of data on the server running this code

#

it should store it, yes, and that will consume memory. and i need to make sure that this is freed afterwards, since it can be lots of GBs worth of data

#

it sends it constantly, as long as the receiver is able to receive and that we have available data in the correct order

#

the inputs are sending quickly, but the problem may arise when the receiver is not able to receive quickly enough

#

then the memory on this machine will start to be utilized to buffer the data

#

so you mean once i have issued .send() on the socket, it's no longer "my" problem?

#

meaning: my memory's problem

#

but isn't this something that's done after the process terminates?

#

not every input, but every socket

#

what's the difference between a process pool and just processes?

#

yeah, so i can have a shared socket for the outgoing data and all the different threads can write to that? but i still need to make sure that this happens in the right order, so i need to have an "organizer" of some sort that will monitor a queue

#

or i could just use async?

#

did you see the link i posted?

#

yeah, but the conclusion i'm getting from that is that i can't use threads safely and get garbage collection

#

hm, i'll look into this again. see if i can make sense of it

#

because i have code that uses this that has been running for a few weeks and now its memory usage is roughly 3 GBs

#

and it's not doing anything

#

it's not serving clients

#

but its memory has bloated and i have a memory leak

#

that's the whole script

#

it seems like if i let this run for a while and handle a few incoming streams, then the memory usage for this script will never go down, instead it will constantly keep the memory usage of its "largest" run

#

well, this is async code, so it doesn't spawn any processes

#

but i'm considering rewriting this to use processes instead, to make sure that the memory is wiped when the process is terminated

#

but the problem i'm facing is how to make sure that the memory isn't bloated in the main process, but instead in the different processes

#

if that makes sense

#

right now i'm considering just outputting ALL data to the shared outgoing socket and then that process will have the job of reordering the packets and then send it to the end destination. it's not pretty, but it'll work

#

ok, cool 🙂

#

.. preferably not in Go, though 🙂

flint nexus
#

gotta run, but i'll check back here tomorrow morning. thanks in advance 🙂

flint nexus
#

Hehe

pure thunder
#

Implement backpropagation neural network, trace the error and compute the accuracy.. can anyone help with a step by step instructions?

pearl anchor
#

im having some difficulty understanding how dhts work and how do they function as a look up. i understand each dht implimentation varies and dependant on requirements but generally, how does a mdns dht become reachable. if im writting a p2p software that tries to connect to a mesh net, how can i let other devices on the same network independantly find the nearest peer.

steep solstice
#

What is the easiest way to create local connection between 2 computer in python(they connect to same WiFi)

#

Also need to capable to make multiple different connection to different computer

steep solstice
#

It work terrible for me every time I try lmao

steep solstice
#

Don't need to send twice lol

#

Then one more question, are there any built-in library that can do similar thing except socket?

coarse summit
steep solstice
#

Like I tried to connect between my laptop and my phone(since I don't own a second computer), it failed to connect

#

And another time I tried between 2 public computer on same internet

#

And also doesn't work

#

Like at the connection and accept stage

edgy pelican
steady horizon
#

Look into asyncio.start_server and asyncio.open_connection

#

It is high level and uses async/await syntax though

#

There are examples in the docs, look up "Python Streams" on Google

edgy pelican
#

well yeah, but it wnot help that problem

steady horizon
#

You can get a list of usable TCP addresses for the server by running this on the server machine:

from socket import getaddrinfo, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP
from pprint import pprint

pprint(getaddrinfo("", 8000, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP))

The address "" means "any interface/address available".
Just as an example, this searches port 8000 (but could be anything you want, this does not check usability).
AF_UNSPEC means "an unspecified address family", so either IPv4 or IPv6 addresses, maybe others too.
SOCK_STREAM for stream sockets.
IPPROTO_TCP for sockets using TCP

steady horizon
#

Or use this PowerShell command and pick an address

(Get-NetIPAddress -InterfaceAlias '*Wi-Fi' -SkipAsSource 0).IPAddress
static ether
#

I want to know how a http/3 response for sending html css and img looks like

steep solstice
ocean bay
stoic moth
#

<@&831776746206265384>

remote citrus
#

@open olive, we are not an ad board.

static verge
#

Hi, not sure where the right place to ask is. I'm interested in fiddling with code for multi-party video conferencing. I'm trying to get some footing.

#

This is how far I've progressed. If you know any complete projects, please point me in that direction.

#

Else we can have a long chat about this topic and make it simpler to digest.

ember ledge
static verge
ember ledge
#

We help with Python code or issues/questions, not JS.

static verge
#

you're right, I'll rework it in python before speaking to a single soul. What would I need, opencv, pyaudio, asyncio, aiortc, threading, sockets, requests... I just asked myself: do I need to be doing this, or has someone done this already? Do you have an answer to that question? There is no apropos to fetching projects that I know of.

ocean bay
#

Its a preconfigured web conferencing web app I think u just gotta do some docker install wtv

static ether
ocean bay
#

I got this off google but this is what an http3 packet would look like fully encapsulated

#

an http response is just an http response

#

that whole thing parsed

fluid leaf
#

guys you have channel i want to learn administration control for my work im currently in computer laboratory assigned im freshment i want to learn basic role of an admin please can someone help me?

edgy pelican
fluid leaf
static ether
# ocean bay an http response is just an http response

Thanks for the Answer

HTTP response is not just HTTP response as HTTP version 1.1, 2 and 3 all have somewhat different response. I want to just see how a raw HTTP 3 response looks because I want to know how more than one file in is sent in one response using UDP, QUIC, etc in HTTP 3

obsidian tinsel
ember ledge
obsidian tinsel
#

yes im pretty sure

ember ledge
#

You probably have to specify the name=value in the parameters

mystic mauve
#

If the name is "socket.py", the issue occurs because Python tries to import local data first instead of the library. Change the name to something else, but not "socket".

obsidian tinsel
#

no its not socket i made sure of that

steady horizon
obsidian tinsel
#

no no its not

#

anyway i fixed it thanks y'all

steady horizon
#

Also just so you know, AF_INET and SOCK_STREAM are the default arguments to the address family and socket type

steady horizon
obsidian tinsel
#

in the help section my close post isn't working any idea how to close it?

steady horizon
#

!close

fervent thunder
#

do i need to keep my intermedia ca's .csr file around after i sign it with my root ca?

ember ledge
#

I LOVE NETWORKS WHEYYYYYY

karmic spruce
#

indeed

ember ledge
ember ledge
ember ledge
haughty birch
#

Nice

#

I guess I will try this domain for some time

edgy pelican
#

@ember ledge as a next project, try making it without knowing the key beforehand

#

tip: ||check out how CAs work||

ember ledge
fallow furnace
ocean bay
#

the int(mode) check in run.py seems like a prime candidate for the strategy pattern

rugged cedar
#

hi guys, i wanted to learn Python. and I dont know anything about codes and programming, maybe a little, can anyone help me learn ?

ember ledge
hallow vine
#

why dose python get the riff raff 🤣

coarse summit
long linden
#

Hey , may i ask for help , i tried to connect to clients and i want the first client to get the message that the second client connected , heres my code:

ember ledge
#

From where do you have that

hardy quarry
ember ledge
#

Then there's likely an explanation before/after

hardy quarry
#

its just in a section with questions

#

but i couldnt find how to calculate it in the chapter

ember ledge
#

You don't get random questions in a text book

hardy quarry
ember ledge
#

You get questions based on its content, so use the content to answer

hardy quarry
hollow stratus
#

anyone know a good network api

crystal current
hollow stratus
crystal current
hollow stratus
#

k

stray nest
#

hello there, pretty much new here. wondering if anyone knows how to fetch API using python requests with some generated headers and how to detect those generated headers

https://api.debank.com/feed/hot_list?limit=100 <- lets say for this endpoint, i want to fetch it datas. While it might work a couple of times, i always get rate-limited after a couple of request. I came to a conclusion that I am getting rate-limited because it keeps generating new nonce, sign, or ts. (can someone pls confirm if this is true too) or even checks if the same User-Agent keeps getting in which I dont think should be the problem

Oh and fyi I call request for every 50 minutes which doesnt make sense to get a 429 response (too much requests)

Thanks in advance

steady horizon
#

You have to respect the API's rate limits, which the API needs to cover somewhere in its documentations. In any case, it's a good idea to store cached data and only fetch again when it is necessary to get an update. As an example, you can have fetch functions which periodically fetch up-to-date data every now and then according to what the rate limit on a specific resource allows, cache the data, and use non-fetching functions which use data from the caches

signal cloud
#

@ember ledge can use more strong encryption to create a encrypted tunnel for client and sever

edgy pelican
#

(which isnt saying much)

signal cloud
edgy pelican
#

its like how vpn companies say "military-grade encryption"

#

well no shit everyone uses "military-grade encryption" (well, except for people who use outdated shit, and chacha20 probably but its about as secure)

signal cloud
edgy pelican
#

VPN encryption is as good as it can be

signal cloud
#

Multiple proxies

#

VPN set us at one location and can be filtered by sys admin

edgy pelican
#

back

edgy pelican
signal cloud
edgy pelican
#

what im saying is that strong encryption isnt hard

signal cloud
#

Yup can be used for chat apps too made by u right ✅️

edgy pelican
signal cloud
#

What u do ? College ? Job

edgy pelican
#

grade school :P

signal cloud
#

Cool

stray nest
signal cloud
#

anyone did ssh using paramiko library ?

steady horizon
# stray nest any guidance at this? and i do respect the APIs rate limit, it is just that for ...

I have yet to implement what I talked about. I suggest looking for an official Debanked API wrapper on PyPi. If none exist, you're going to have to implement one on your own. Being rate-limited in HTTP means receiving an HTTP 429 status code. In short, this response code is received when making too many requests regarding a resource, not because you included the wrong headers in the request. RESTful APIs respond with 429 responses to tell their users they won't be served for sending the same request regarding a resource until a duration of time passes or until a date is in the past (dictated by the Retry-After header in the error response). You can learn more about caching specifically in HTTP in here. I don't know which headers Debanked's API expects you to inspect for caching its resources if it even uses any. It might just be in the documentations

crystal current
stray nest
# steady horizon I have yet to implement what I talked about. I suggest looking for an official D...

i see, thanks for the insight... are u 100% sure about the no headers in the request though? because I am seeing a changing nonce, sign, and ts on the front-en (lemme link u up the website url) https://debank.com/stream?tab=hot and u can see at the end of request headers there are changing generation of those parameters. Also, debank openAPI doesnt provide this endpoints.

DeBank

The real Web3-native messenger and the best web3 portfolio tracker that covers all your tokens, DeFi protocols, NFTs across all EVM chains.

stray nest
#

thanks for the help though

steady horizon
stray nest
#

still wondering why only debank has this nonce and stuff

#

just tested in the server, 1 request per 1 hour and still isnt working, getting 429 after 5 requests

#

and trying on the front-end too, refreshed 10 times in a minute and it's still working haha

steady horizon
#

Considering said front-end provides additional headers in its requests, it might be an issue of authentication or authorization

#

The API probably wants you to authenticate before being able to make these requests

#

Meaning Debanked's API is weird for sending you this error response for an authentication error

stray nest
#

which gets some random id im not even sure how to get those

#

at first i thought it shouldnt be a problem since i could be fetching a couple time

steady horizon
#

Well do you have an account?

#

It's weird that you need an account key and not some specialized personal API key

stray nest
steady horizon
#

Then use that key if it abides by their terms of service

stray nest
#

lemme shoot u with a screenshot

stray nest
#

and would have to wait another 5 hrs to be able to fetch again

#

while i could reload website normally

#

10x every minute

steady horizon
#

To be sure, are you making HTTPS requests?

#

In any case, the X-Api- headers seem vital for it to work. Aren't they covered in the documentations of the API?

#

You may want to remove this screenshot from Discord so people don't authenticate as you by the way

stray nest
stray nest
stray nest
#

https request

steady horizon
#

The Account header might be vital too, it isn't standard. It's weird that it isn't prefixed with X-Api- like the rest

#

Though maybe it's because it isn't necessary for the API endpoints to be used

stray nest
#

is it possible they're stored in the front-end?

steady horizon
#

And it seems you should be using the API through specific endpoints

stray nest
steady horizon
#

Which feed doesn't seem like one of the endpoints

stray nest
#

the problem is, the datas i want arent provided thru their made endpoints

#

haha

steady horizon
#

Then it seems you can't legally access feed data

#

If that is a thing

#

Or their documentation is severely lacking which is unlikely

#

Maybe it is true that the documentation is lacking because you seem to be able to use that endpoint through a web browser

#

Where did you even get that endpoint from to begin with

stray nest
stray nest
#

im still wondering about these x-api stuff tho, like how r they generated? because i have checked repeatedly that there r no back-end involved for these keys

steady horizon
#

Should've been hidden behind the servers of the actual website

#

In any case, you shouldn't try to use these API endpoints because they're undocumented

#

Might want to contact them about it

stray nest
stray nest
#

would they tolerate me knowing i been trying to scrape something they dont provide tho? hahaha

steady horizon
#

It's a fault on their part for failing to hide this side of their service, but it doesn't legally allow you to use/reverse engineer it

cold adder
#

hi there is some one familiar with the DNS server Bind9 in Ubuntu22.04?

#

is for a task i have to do but i have an error in the /etc/bind/db.local config it probably in the MX well i attach some photos and if someone is interested pls tell me what should i do I'm attaching a config photo a cheack photo and a status of the server cheack

#

ty

#

ik this may not be the server correct to say this but if someone know what should be could help me i would be happy 🙂 ty

radiant fern
#

networking

#

intersting

#

but its seems hard to learn

#

what kind of networking is strong

#

for Penetrate

#

as n Security purpose

long gazelle
#

Good day guys!!

I think I am in the right place,

Please did anyone knows how run a twisted server in production????

Thanks in advance

grizzled harbor
#

im looking to setup a local proxy server that i can route all my traffic through and modify as i need
something like mitmproxy, any way i can do that?

crystal current
grizzled harbor
rapid shadow
#

this question arises from my superficial understanding of the OSI model and websocket connection:
It came to my understanding that in the context of ws connection between a client and a server. only the server sends PING frames.

  • what would be the benefits/drawbacks (if any) of explicitly making the server disregard any incoming PING frame?
ember ledge
#

ICMP is sometimes blocked to avoid letting outsiders know, "it" is up, by preventing them to send an echo and make an attack a little harder, like doing a port scan, because u'd know, which one is up and the scan would be profitable. (correct me if wrong)

hallow vine
#

most of the time you can just send a SYN if ICMP is blocked

rapid shadow
#

so either i have some serious ressource reading to do or we're talking about different things.
the PING frame i'm talking about is the one sent by the server in what is called heartbeat whatchamacallit.
the server pings each of the connected clients, regularly to see if they're still reachable or not.
it's delivered through the websocket connection

edgy pelican
#

hi rme

snow yoke
rapid shadow
# snow yoke https://stackoverflow.com/questions/46111656/must-websockets-have-heartbeats Jus...

yeah, i came across that answer. what i understood is that:

  • servers sends pings, not clients
  • the browser api (WebSocket) doesn't even expose a way to send a ping from the client because that isn't what a client sends
    then, some time later, while reading about nginx, i came across a directive to explicitly disregard PING frames. and that's why i asked whether to set it or not.
    now, after a bit of thought, i'm tending towards not having to explicitly disregard these frames, because:
  • for a ping to be sent, a ws connction needs to be instantiated and in the end-of-world scenario where someone managed to establish a ws connection outside the vue app, they can check the status of the connection by other means.
  • i can easily forget about having set that directive in some distant future and cause myself unnecessary pita if i ever wanted to make something that relies on my server being pinged that way
snow yoke
# rapid shadow yeah, i came across that answer. what i understood is that: - servers sends ping...

Well if the server or client are using PING/PONG events to determine whether the heartbeat is still alive (which is the primary purpose for this) then I'd imagine it might be an issue if you're dealing with clients that are expecting them.

If you own both the server and the client; then it seems reasonable if you have some other way to determine whether a specific client has and is maintaining a connection. I'm not sure why you'd explicitly forbid this behavior personally, because it's kind of handy as a level of abstraction to know if your websocket is still alive.

If the server is sending PINGs, the and the client is responding with the appropriate PONGs, then that's still the client implementing that behavior. If you only control one point in this chain, there could be logic you're not accounting for in whether or not some sort of reconnection behavior is dependent on these events occurring.

Typically a lot of what you're going to read about handing PING in the context of networks is going to be as other users suggested, ICMP 8 0 events. They have some dangers associated, but a PING/PONG event in the context of a websocket is probably less of a concern.

rapid shadow
#

what i was asking if i should do or not is: Should my server acknowledge incoming PING frames, at the NGINX level.
it will be always able to send them, as in outgoing PING frames to clients.

snow yoke
#

Ahh, I'm sorry I misunderstood.

rapid shadow
#

no worries, lol. you pushed me into seriously stepping up my defense game anyways

snow yoke
#

I don't see any reason for you to explicitly forbid that behavior; but provided you're the writer of the client and you aren't going to implement any logic that relies on the client sending a PING to the server, then I don't see it being an issue disabling it.
Clients can still send PING events, and the server should still respond with a PONG.

#

Whether you want to take advantage of that is entirely a design decision, and I don't think it has any security implications in either direction that wouldn't be covered in the establishing of the connection anyway.

rapid shadow
#

the thing is, what i gathered to understand is that this isn't anything like the ICMP ping, this is a websocket frame that doesn't carry any data except that hex that any client implementing the ietf stnadards of websockets responds to appropriately

snow yoke
rapid shadow
#

yeah, what i'm gonna focus on is to learn and understand exactly how the browser ~instantly knows when a ws connection has been terminated. it checks the socket through an os sys call, alright. how the socket ~instantly knows that the ws connection has been terminated, and so on and so forth

#

i know that it's at the tcp level (for the socket part), but still, i have too many knowledge gaps that i frankly am not confortable with

snow yoke
#

Sockets are implemented through TCP;
My impression (and honestly, I truly don't know) is that SYN/ACK flags are degraded over websocket connections, they likely emulate UDP afterward, whereby you're sending minimal headers with data-- without actual acknowledgement; it would kind of defeat the purpose of a websocket if it was just a regular TCP connection.

Since you're no longer tracking SYN/ACK sequentially in that manner, you probably need some way to check that your connection has degraded or disconnected entirely.

#

Wireshark or something would probably reveal this behavior pretty transparently-- you should be able to see how your syn/ack flags increment during that particular TCP session.

rapid shadow
#

i see, thanks, man, yeah i think learning wireshark is a must

#

i believe that it operates over a single tcp connection, it starts as an http request with an upgrade header, and once it's in the realm of websocket, it's pretty much magic to me (the inner mechanics)

snow yoke
#

Yeah I'm not super up to speed on the specific inner workings, I just know that conceptually I don't think websockets could support the speed and multiplexing they're intended to have without kinda' stepping around the TCP protocol after the initial handshake.

rapid shadow
#

hmm, i understand. if you have any ressources you can throw my way, i would love it. for now, i'm pretty much stuck between surface level litterature and RFCs lol
even title of books that you found very insightful when it comes to networking

snow yoke
rapid shadow
#

i admire your academic breath abilities, that must've not been easy at all, lol

#

💯% for the books, i will ping you with titles whenever i found a really good one

snow yoke
#

Eh, just don't ask me to do anything beyond addition and subtraction in math, that ship has sailed. 😅

rapid shadow
#

lmao, well you did the brunt of the work when it comes to that, so you earned your right to chill

ember ledge
#
snow yoke
ember ledge
#

you are welcome. Networking can get crazy by going in too deep.

#

so, i feel.

edgy pelican
#

rfc goog

ember ledge
#

I played around a few times with scapy to craft and understand "packets" and so on but I need to do it more frequently.

#

while looking in wireshark, what is happening.

edgy pelican
#

ah cool

snow yoke
ember ledge
#

make it, break it, learn. Practice, practice, practice and repeating. This is the way, I do but unfortunatley I forget stuff, if I haven't looked into it, for longer time.

#

(at home ofc.)

steady horizon
# snow yoke Sockets are implemented through TCP; My impression (and honestly, I truly don't...

From my research, it's just a different application-layer protocol which uses the same ports (

80 for regular WebSocket connections and port 443 for WebSocket connections tunneled over Transport Layer Security (TLS)
).
I think the purpose is simply using a different application-layer protocol than HTTP/1.1. Read https://stackoverflow.com/questions/28582935/does-http-2-make-websockets-obsolete - seems like web sockets is a technology which is superseded by HTTP/2.0. If you want UDP behavior for HTTP, why not use HTTP/3.0 which is implemented atop QUIC over the actual UDP protocol?

steady horizon
# rapid shadow yeah, what i'm gonna focus on is to learn and understand exactly how the browser...

Python TCP socket methods raise an OSError exception when the connection is terminated improperly due to a problematic internet connection or due to a clueless peer or connection problems on either peer's side. According to TCP's RFC, connections terminate properly when either peer sends a packet with the FIN bit flag set and the termination process goes on to completion. Python's socket.socket.send sets this bit flag when sending an empty message

rapid shadow
#

so the PING frame is for the server to check the health of a websocet connection. it seems like the very nature of the ws connection can create a situation where the tcp connection is open but on the application layer level, the webocket connection isn't operational

#

there's no way around it. this is ietf RFC realm, i can't rely on tech authors' effots alone

signal drum
#

I am in a situation where my school network manager can see all my network traffics, should i use tails linux or just a vpn is enough?

gloomy root
#

I am under the assumption that you are in school

#

so the question arises, what are you looking at that would raise questions by your network manager

#

but yes a VPN would be enough assuming there is not a system installed on the device

gloomy root
#

why would github raise questions

signal drum
#

My school blocks github because of the 0.5% of bad softwares on it

gloomy root
#

that is dumb

signal drum
#

i agree

karmic glen
#

I was working on youtube API and I exceeded my quotaaaa 😭

#

help meeee XD

ember ledge
#

All you have to do is wait.

karmic glen
# ember ledge All you have to do is wait.

I know 😭
But I'm stupid for not being clear about my intentions behind my message and I apologize for that.

I wanted to know if, with the help of testing libraries, one could just do a few general request and save them in JSON files, then create unit testing functions instead of just sending a request then realize I wrote videoId = requests['videoId'] and got requests is not defined because I actually named my variable request XD

You know, just to avoid those long hours just "writing" the code if that makes sense?

ember ledge
#

You can, no need of libraries either

signal drum
edgy pelican
#

are they just passively viewing it or mitming the traffic

quartz frigate
#

It's a school

#

They have some legal requirements to make a "best effort" attempt at certian things

edgy pelican
#

anyway

uncut mulch
#

is it possible to create a c++ server socket, host it on your ip, and then try to connect to it using a curl request on windows? like Im trying to create a c++ rest api from scratch using sockets, and im wondering how can i test it,so for testing it do I have to create a client socket too?? im wondering how to simulate as if the server has recieved a http web request .

Currently on using curl curl -v http://localhost:8000/ im just getting the error where the server refused to connect.

ocean bay
#

very beginner question but what exactly does it mean in the docs when it says socket.socket() 'creates' a socket https://docs.python.org/3/library/socket.html#socket.socket? from what I read a socket is just an endpoint that is ip + port, so there isn't really a 'creating' of a socket. can someone please explain to me thanks

steady horizon
#

Web browsers can connect even to local servers like these, so it's definitely possible as long as you connect to the right address

steady horizon
#

All via different methods of the same type of object

#

You construct sockets to communicate over TCP when you do socket.socket(). The default arguments construct a blocking, streaming TCP/IP socket, but you can override any of them by passing different arguments into it

steady horizon
surreal pumice
#
server_socket = socket.socket(socket.AF_INET,  socket.SOCK_STREAM)
server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1,)

i am not sure what the second line does
if you could clarify it to me

crystal current
edgy pelican
#

wrong channel, #ot0-psvm’s-eternal-disapproval is more suited for this

and also please read the channel description next time, located on the top of the discord app/web page

red tendon
#

Um what does jo-selfie-pond mean?

edgy pelican
coarse summit
edgy pelican
#

oh

oak wigeon
steady horizon
surreal pumice
#

mm
thanks🙏

steady horizon
#

Needless to say, the implementation and behavior is different across different platforms

edgy pelican
signal drum
#

sorry for the late reply

tall dome
#

I'm working on a project that has a tcp socket for clients to connect to and I want to encrypt it with SSL. If I get a cert from let's encrypt will clients need to install it before connecting? Or will it be like HTTPS and automatically be verified because let's encrypt is already trusted by clients?

rapid shadow
#

i see, i see, thanks man. well at least this convinces me further that it's at a lower level than anything i'd dabble in

#

lmao, so true

#

i hear you. the thing is, it's like when you swim in clear water, the bottom is always way further deep than it seems at first lol

#

yeah, i really like that python always try to abstract complexity but not obscure it. many times, it exposes the underlying endpoints of the C api. like in socket, for example. it's literally the same hooks and options

#

hahaaaa, amen

#

that's very true

#

i just checked coq on google, that's in the realm of sorcery for me, lol

#

dang

#

this, i think i kinda get, yeah

#

i'mma ping you in an ot channel, lol, i'm sorry if this is getting annoying

edgy pelican
signal drum
edgy pelican
#

yeah just give up :p

#

esp. that you doing it would probably anger the school

steady horizon
# tall dome I'm working on a project that has a tcp socket for clients to connect to and I w...

If I get a cert from let's encrypt will clients need to install it before connecting?
You can check that by simulating the case and testing. Download the Let's Encrypt CA chain and use it for the server and not for the client, explicitly so, and try to connect the client to the server with a default context like from ssl.create_default_context. If the TLS/SSL handshake fails, an ssl.SSLError exception will be raised on the client program. Look out for one about an untrusted host certificate in order to get your answer.
Or will it be like HTTPS and automatically be verified because let's encrypt is already trusted by clients?
Read Python's explanation of certificates. Additionally, look at the examples of using Python's ssl module to understand how verification is done on both sides. If you're using asyncio to create either the server or the client, peer verification is set up by passing an ssl.SSLContext object to the ssl parameter of the respective functions and a string for server_hostname for the client side function. Encryption in TLS or SSL is done using ciphering protocols at a networking layer which, as an application, you don't control beyond being able to choose security settings and letting it do its job basically. Verification happens in the server and client programs themselves. Read the security considerations section about certificate verification settings and cipher selection settings as well as other security considerations

signal drum
edgy pelican
#

or do you need to enter your password the first time you join the internet

#

if so you're fucked

edgy pelican
#

like, enter your laptop password

signal drum
#

its a wifi password

signal drum
#

but why would it matter?

#

Just wondering

edgy pelican
#

just wifi password and you're connected?

signal drum
edgy pelican
#

did you have to do anything special to enter the wifi (install anything, download something, ...)

signal drum
#

I think their wifi authentication is username and password

edgy pelican
#

wait then how can they see your screen

#

that deosnt make sense

#

and how do you know that in the first place

#

like, know they can see network traffic

signal drum
#

oh theyre different

#

when i say they can see your screen it's when i'm using school computer

#

They probably can't see decrypt the request if I'm using my own laptop

edgy pelican
#

and avoid doing stupid stuff on school computer

signal drum
#

and using just a vpn is enough?

edgy pelican
#

you probably wont even needi t

signal drum
#

but they can see your DNS

edgy pelican
#

okay? just change your dns to 1.1.1.1 or smth

signal drum
#

Okay

#

but i have another question

#

what are their ways of them decrypting the request when I'm using school computer?

edgy pelican
#

idk just dont do stupid stuff to be safe

#

i gotta go to class in 3 minutes so cant really explain

signal drum
#

but i know they can see every single keyboard input on school computers

edgy pelican
#

(they can just always look at search history)

signal drum
#

thanks for your help

edgy pelican
signal drum
#

uhm oops

#

good luck then

#

i think i'll go to sleep

zealous flint
signal drum
steady horizon
# rapid shadow <@456226577798135808> does this question ^ even make sense? also, how does an os...

Because TCP/IP sockets are connection based, a good indicator is checking whether the socket's IP address and TCP port, which are a TCP/IP socket's unique identifiers basically, are in use.
[Explained by Wikipedia:]
After a TCP/IP socket is done as in programmatically closed/released and the connection is virtually gone, the system waits for a few minutes before allowing the IP address and TCP port to be reused for new connections. Wikipedia explains this here too and there's a diagram :D (although it is unrelated).
[Not explained by Wikipedia (as in I didn't link a Wikipedia article):]
You can configure it so the system doesn't delay reusing by setting a socket option like:

sock = socket.socket()
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, True)

This apparently works on some platforms, but the reuse delaying behavior for a connection is platform specific and may require setting other socket options on some platforms to match results. It all is explained in this Stack Overflow answer, which, I have to note, has an astoundingly impressive number of upvotes.

Other than that, ungraceful disconnects means resending packets a few times to see whether the peer is responding or timing out on waiting for an acknowledgement, truly disgraceful. I know setting a global socket timeout in Python is possible as a function under the socket module, but I think resending is done by timing out then resending then repeat basically by the developer. The heartbeat system in web sockets is basically a timeout based system for (hopefully gracefully) disconnecting yourself unless your PING message was acknowledged by the peer with a PONG message on time (and not by looking at TCP ACKs for God knows what reasons). Heartbeat control frames are literally interjected between other frames, by design, every heartbeat

The Transmission Control Protocol (TCP) is one of the main protocols of the Internet protocol suite. It originated in the initial network implementation in which it complemented the Internet Protocol (IP). Therefore, the entire suite is commonly referred to as TCP/IP. TCP provides reliable, ordered, and error-checked delivery of a stream of octe...

rapid shadow
#

this is truly trully a nice explanation

#

i see very well, now, thank you ( :

rapid shadow
steady horizon
# signal drum I am in a situation where my school network manager can see all my network traff...

I'm not keen on how VPNs, beyond being proxies, attempt to hide personal info (sorry VPN ads on YouTube, I didn't listen one bit), but I think that if you're using the school's network, through WiFi or through Ethernet cables, then you're physically giving access to all of your traffic through their network routers/switches/whatnot and there's nothing you can do about them choosing to monitor this traffic except by begging

woeful minnow
#

How can I get the symmetrics key in python SSL library (I want to capture my traffic in wireshark and dycrypt them):

i open socket like this:

        raw_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        raw_socket.connect((self.hostname, self.port_number))

        self.raw_socket = raw_socket
        sock_addr = raw_socket.getsockname()
        print(f'connected to: {self.hostname}:{self.port_number} --> {sock_addr[0]}:{sock_addr[1]}')

then in other function I do this for creating ssl context on socket:

        # Create SSL context
        ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_CLIENT)
        ssl_context.check_hostname = False
        ssl_context.verify_mode = ssl.CERT_NONE
        ssl_context.set_alpn_protocols(['h2'])

        # Wrap the raw socket with SSL/TLS
        ssl_socket = ssl_context.wrap_socket(self.raw_socket, server_hostname=self.hostname)
        self.tls_socket = ssl_socket
        print('TLS connection established')

How can I get the symmetric keys here like SSLKEYLOGFILE format in browsers. I could not get the keys with setting the SSKEYLOGFILE env variable.

the format for LOGFILEKEY that wireshark uses is like this:

CLIENT_HANDSHAKE_TRAFFIC_SECRET d64ca46ac763ec65fba8efdb5fa88842b7e37796f5b4312985739af37a572cea dfa5f6e1c83d6f0e6f8b80411d84318ae4af8e56e0beb83faea6d76396501daf
SERVER_HANDSHAKE_TRAFFIC_SECRET d64ca46ac763ec65fba8efdb5fa88842b7e37796f5b4312985739af37a572cea 4c81cfd56f7e7bd4fd929bf059d29e2e230eb13039a22405cb5eeccf47e36a54
CLIENT_RANDOM 2da4c0fa3cae4d19fe4306b166e0c452cd49686d35da63cec5e112efb1ec2151 ae2c318e7e3a08f57398c28fb73da11f2feb50c5a8997330a6183b9ab75bdcd37fb2030eb921dc797d314e964c7a71c1

edgy pelican
#

idk read openssl docs

steady horizon
#

I thought private keys change each session

steady horizon
hot helm
#

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED]

I used a python package called python-certifi-win32 to fix this issue, but when I make an executable and run the file I am getting this error again. I also referred from another post and directly imported certifi-win32 package into my program and it worked except I am getting the same error in another part of my project.

This is the fix I got from another post.

if sys.platform == 'win32':
    import certifi_win32
    os.environ['REQUESTS_CA_BUNDLE'] = certifi_win32.wincerts.where()
    certifi_win32.generate_pem()
hot helm
# hot helm ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] I used a python ...

This is the error I am getting after trying these fixes:


Exception in Tkinter callback
Traceback (most recent call last):
  File "tkinter\__init__.py", line 1948, in __call__
  File "customtkinter\windows\widgets\ctk_button.py", line 554, in _clicked
    self._command()
  File "src\app\frontend\main_ui.py", line 51, in run_orm_google_sheets
    status = orm.run_google_sheets_save(drive_folder_id)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "src\app\backend\oscilloscope_report_maker.py", line 219, in run_google_sheets_save
    spreadsheet_id = gs.create("Report")
                     ^^^^^^^^^^^^^^^^^^^
  File "src\app\backend\google_sheets_api_methods.py", line 41, in create
    .execute()
     ^^^^^^^^^
  File "googleapiclient\_helpers.py", line 130, in positional_wrapper
  File "googleapiclient\http.py", line 923, in execute
  File "googleapiclient\http.py", line 222, in _retry_request
  File "googleapiclient\http.py", line 191, in _retry_request
  File "google_auth_httplib2.py", line 218, in request
  File "httplib2\__init__.py", line 1724, in request
  File "httplib2\__init__.py", line 1444, in _request
  File "httplib2\__init__.py", line 1366, in _conn_request
  File "httplib2\__init__.py", line 1158, in connect
  File "ssl.py", line 517, in wrap_socket
  File "ssl.py", line 1075, in _create
  File "ssl.py", line 1346, in do_handshake
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:1002)
#

I hope this is the right channel to ask this question.

steady horizon
#

@hot helm is there anything wrong with the default context created by ssl.create_default_context?

signal drum
#

i think

hot helm
#

All ik is that, the company in which I am doing the internship in uses self signed certificates, and they didn't work in the beginning and later I tried the fixes as I mentioned above which worked well but didnt hold up after making an executable.

Im sorry if I sound like a noob 😭.

steady horizon
#

The context created by the ssl.create_default_context function has access to CA stores with trusted authorities for everything I've ever tried connecting to

steady horizon
hot helm
#

Oh okay

steady horizon
#

Could be due to not having a trusted authority in the CA chain, or by not having verified the host during a handshake

hot helm
#

I think it's due to not having a trusted authority.

steady horizon
#

I'm assuming you're using a service which uses TLS, right?

hot helm
#

Yeah

#

Have you worked with Google's Python API? I am using trying to connect to Google sheets using that. That's where the error comes.

#

Ik there is a fix by disabling the verification (I read abt it somewhere) but I also read it is not recommended to do so.

steady horizon
steady horizon
#

You would be exploitable by man in the middle attacks

hot helm
#

I dont think I have control over what certificates I use. I dont have access to things like this. (As I mentioned I am intern)

steady horizon
#

Does the Python library for Google API not have a parameter to set a TLS/SSL context?

#

It needs one one way or another

#

Maybe the library uses its own certificates, but that means you wouldn't get this error unless they messed it up. Maybe the library is outdated or doesn't request new certificates after they expire automatically

steady horizon
steady horizon
#

It seems as though controlling which CA chain to use is possible, so just get one which Google API trusts

#

Try use those

hot helm
#

Ah alright, ill try these. Thank you

unborn ridge
#

I am trying to send requests to a (Linux+docker) server that is on my network (different PC).
It works for the first few requests but then it cannot resolve the hostname. I'm not sure why this would be. Full error and additional info can be found in this help post

ember ledge
#

Anyone here familiar with aioxmpp? I'm running into a host-unknown error message when trying to open an XMPP connection.

import asyncio
import aioxmpp

loop_policy = asyncio.WindowsSelectorEventLoopPolicy()
asyncio.set_event_loop_policy(loop_policy)

async def main():
    username = '...'
    password = '...'
    resource = '...'
    domain = '...'

    client = aioxmpp.PresenceManagedClient(
        aioxmpp.JID(username, domain, resource),
        aioxmpp.make_security_layer(password)
    )
    async with client.connected() as stream:
        ...

asyncio.run(main())

I have verified that domain exists with socket.getaddrinfo. Am I doing something wrong when trying to connect?
Traceback here.

woeful minnow
viral agate
#

hi all just got a quick question, I was trying to go a simple get request via python requests but the site kept returning an error while it worked on curl so I tried http.client and voila it worked, so this led me to question why didn't the requests module work? I assume the site's blocked the python requests module fingerprint but am not so sure, would like to hear what do you guys think?

edgy pelican
steady horizon
#

If you'd gotten responses for requests you sent with the requests module, it might've been caused by sending too many requests and the server not liking it. http.client might be using a different user agent that might be all the server has to go off for blocking clients

steady horizon
# woeful minnow I know how to decrypt packets in wireshark with the keys. I do not know how to g...

There may be better ways than automating a GUI program to get content which is displayed through it. If it doesn't have a CLI, then better options include using scapy or generally other tools which sniff packets and let you work with them nicely. If you're on Windows, there's pktmon under System32 which is on PATH by default. It produces .etl files which can be turned into .pcap files in case you know either file formats enough to be able to get the decryption keys, the etl2txt produces .txt files which don't include payload as far as I know

viral agate
viral agate
craggy ocean
#

Im not sure if this is the right channel, but i started trying to code for the fgirst time yesterday and didnt know what to code so i tried to code a "friend" for fun, but it is so confuesing, if any1 wanna help please dm me. And yes i know it sounds like im lonely... im not..

edgy pelican
#

please read the description of the channel before sending any messages

craggy ocean
#

Olau thanks

whole furnace
#

is there a way to carry out a “ping” command without using os.system or some other equivalent

#

because its OS dependent

#

however i’m pretty sure icmp requires root privileges so i’m not sure how that would go

#

i figure the only alternative is to carry out a tcp ping using sockets

crystal current
round eagle
#

Does anyone know how to make a minecraft bot that joins servers in python?

ember ledge
#

Lots of people do

steady horizon
#

How can that be legal

static ether
#

We all know that mobile phones can transmit electromagnetic waves then why can we access the hardware that does it with python or any other language

ocean bay
#

phones run on operating systems, operating systems determine when to send a wave, operating systems expose apis to interact with them, languages use those apis to do stuff

atomic wyvern
#

might look a little into the OSI model to get a feel for how those relate

rigid valley
#

Hello everyone! I recentlyi installed python 3.11.6 on wsl throught pyenv . I then ran python -m test test_socket to check whether this module is installed properly. But the test stucked and remained stucked for hours. I attemped multiple times but it remained stuck. Here is an output of one of my attempts:

0:00:00 load avg: 0.00 Run tests sequentially
0:00:00 load avg: 0.00 [1/1] test_socket
^C

== Tests result: INTERRUPTED ==
Test suite interrupted by signal SIGINT.

1 test omitted:
    test_socket

Total duration: 5 min 22 sec
Tests result: INTERRUPTED

Should I care about it? How to fix it? Will the socket module work properly?
Thanks..

inland rampart
# rigid valley Hello everyone! I recentlyi installed python 3.11.6 on `wsl` throught `pyenv` . ...

hmm, for me (Linux) this test takes ~30s and works on 3.10, 3.11, 3.12.
Googling a little, it seems it's a known bug in WSL: https://discuss.python.org/t/unit-test-test-test-socket-threadedvsocksocketstreamtest-teststream-hangs-on-wsl2-ubuntu-22-04-with-python-3-12-0a4/23017/6

rigid valley
inland rampart
#

The thread claims it's an issue with support for VSOCK. I don't know offhand what this even does (it's for communication between a host and virtual machines running on it, apparently), so you'd want to wait for someone else who does to know for sure - but I doubt it's important; people'd know by now if networking in WSL was broken in an important way.

rigid valley
inland rampart
#

It's an issue with one particular obscure protocol - I wouldn't expect it to extend to anything people actually use often.

rigid valley
#

Thanks

round eagle
#

please please

#

at the same time I am studying 💀

coarse summit
#

!rule 5

errant bayBOT
#

5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.

round eagle
#

oh ok

#

isn't illegal??

#

I am just learning???

#

also its not for hack or for spam bot

coarse summit
#

how do I know

round eagle
#

just I need mine bot

round eagle
coarse summit
#

ill keep the money but it is for learning purposes

#

if you want to do stuff that breaks tos or rules, don't ask people to be part of it

round eagle
#

I didn't break rules

coarse summit
#

because you don't know how to

round eagle
#

if u don't believe isn't my problem

coarse summit
#

I don't believe, that's true

#

but the problem is yours

round eagle
coarse summit
#

please stop asking for stuff that breaks rules or tos

round eagle
#

there are 2 thing and one break rule
spam bot its break
mining/place bot don't break

static ether
timid garden
#

hey guys what is _crsf?

grand kayak
bright meteor
#

speaking of questions, I have a question

is it possible for a process to listen as well as connect on the same socket or with the same address?
I was trying to implement a P2P system using TCP hole-punching and I've read through the code of a Python-based BitTorrent client to see how it can be done, but unfortunately it only implemented the leeching (client) part
if anyone has any example code or repos that implement this (if it's even possible), that'd be helpful

grand kayak
steady horizon
#

They mean listening on port X and connecting to a peer who is listening on port X on their end simultaneously

#

I have no idea how TCP sockets handle handshaking this way

#

Even if it worked

#

Since they send SEQs and all

grand kayak
#

Huh. I see.

ember ledge
#

Hello im networking

grave lily
grave lily
bright meteor
#

sorry, I went to sleep shortly after posting the question

bright meteor
#

it's the bind then listen and connect that's not… happening

steady horizon
#

This ability is not standard between NATs anyway as far as I know

bright meteor
#

even if I remove NAT from the equation, it still doesn't work with, say, the loopback interface

steady horizon
#

It would be too confusing for the loopback interface as the same address will be attributed to two sockets

#

This has to be done on different interfaces

bright meteor
#

right, as in, it can't be done

steady horizon
#

Have you tried running peers from different interfaces?

obsidian ridge
#

hiii

edgy pelican
#

but anyways wrong channel

unborn ridge
#

Im running a server on my local network. When I run my code on a different machine it is able to send and receive data from the server. After X requests (generally between 10-20) it will no longer "be able to resolve hostname" even with a while loop trying over and over for 3 min. If I restart my code it immediately works for another X requests. I am doing nothing special just using a basic requests call to send and receive, no special arguments or anything.

bright meteor
grand kayak
#

don't know if docker NAT is suitable for hole punching, though

bright meteor
#

if docker doesn't simulate the actual behaviour, I might have to find actual machines behind a NAT ¯_(ツ)_/¯

grand kayak
#

or... virtual machines
as a last resource you could use openwrt as nat router

gray gull
#

Hello

#

Is this the Neral network chat

#

Is it possible to build ai whitch only python built in modules

heady breach
#

sounds odd though like the host name is reassigned by dhcp to another device and they both want to own that ip.

edgy pelican
#

@gloomy geyser send your question here, i dont take dms

gaunt apex
#
Network A advertises its routes via provider B. The link between network A and provider B was changing status (flapping) at the following times:

13:30, 13:40, 13:50, 14:00, 14:10, 14:20, 14:30, 14:40
The problem was resolved at 14:45 and after that, there were no more status changes of the link. Initially, the Penalty for network A was 0. With each flap, the routes receive a Penalty of 200. When there is no flapping, the Penalty decreases at a constant rate of 100 every 10 minutes (regardless of the current value of the Penalty).

If the Suppress limit is 650, and the reuse limit is 300, from when to when was route A not advertised over the Internet?

Note: Show the complete solution on paper, and in the text box, enter the time of the cessation of advertising and the time of recommencement of advertising, separated by a comma (without spaces), in the following format:

HH:MM,HH:MM
#

This was my attempt to solve this, however the correct solution is :

14:20,15:40
#

What concept am I missing? Thanks

unborn ridge
#

And then immediately works on the following try

heady breach
unborn ridge
#

I think both use dhcp

#

Unfortunately I have to go for a bit, thank you for your help so far (I did not excpect such a quick response)

ashen jay
#

Is it allowed to ask a question here about an internet issue that's not related to python at all? I'm at a loss for what to try to figure this out and I know there are some smart people here.

atomic wyvern
steady horizon
coarse summit
#

@trail bridge 2 in a row

trail bridge
#

!pban 1168338667169923083

errant bayBOT
#

:incoming_envelope: :ok_hand: applied ban to @marble pivot permanently.

coarse summit
#

you're on fire

trail bridge
#

ty

ashen jay
#

I'm getting no help in the official Wyze discord, and I've hit a dead end with my efforts. Anyone have any tips on how to troubleshoot this? Here's what I said on their discord:

I'm having a really weird issue. A bit over a week ago I bought and installed two Wyze Wireless Video Doorbell Pro cameras and subscribed to cam plus. Immediately after I started running into issues with my internet dropping out. My internet has basically never gone out in the 2ish years I've lived here, rock solid, run a dozen game servers 24/7. I didn't really make the connection at first, my gf started blaming the cameras, but it just seemed like a reach to me... but to appease her and just to see I unplugged both chimes and powered down both cameras for a couple of days and started running network monitoring software. Well, no internet drops at all during that time! So I put them back into service and started testing. So it seems like she can open the app on her iPhone and view the cameras without causing any issues but as soon as I even open the app to the screen where it lists my devices (on my Android) the internet goes out. It's not my wifi, it's not my pfsense box, it's actually the DSL modem completely crapping out. When the issue happens I can't even access the modem's IP address, it's like it reboots or something! Anyone else experience anything like this?

oak flower
#

Hi Guys!
I hope i'm in the right text channel. I have not so much experience at ble programming with python and i have a problem with my project:
https://stackoverflow.com/questions/77415750/problem-at-connecting-of-two-devices-using-python-and-ble

Do can someone help me?
thx very much!

grand kayak
#

hey, you're in the right place.
did you think about what is your server supposed to do?

#

I suggest a simple plain flask app

#

flask can return json pretty easily and is one of the simplest http frameworks out there, very well documented also

#

for the client you can use just python requests also widely used

#

it's not obligatory though. and it's far from one of the fastest web frameworks in python.
you could also look up fastAPI, it's pretty popular too.

#

and deals with json marvelously.

gloomy geyser
# edgy pelican <@265151484780478467> send your question here, i dont take dms

Here or i create a thread ? With my secured chat project i have errors and my errors are The JSONDecodeError on client side and OperationalError on server side, i have a error with database but i don't know how to fix it, i'm not sure if i can send my codes here because it's like 250 ligns and there's no blatant errors but just i dont really know how to fix it

#

This is for everyone, not only for one person

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

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

knotty wind
grave lily
#

Which would be the channel for talking about telephony APIs?

I was looking at Python wrappers for Asterisk, and none of them seems to cover all the bases—not even the non-Python ones. So naturally I created one that would.

patent cedar
#

How can I request content-length when I have a restful api python app?

hallow vine
#

Don't you just set / modify it in the headers when the request / response is made ?

#

Some servers do it automatically maybe you could check with curl or httpie

atomic wyvern
steady horizon
#

There are HTTP/1.1 instances where this header is missing

#

As described in the protocol

waxen talon
#

@covert wind hey can you friend me ? i messaged you in instagram

#

datasiens

sonic vale
#

guys I really need help

random fox
#

?

crystal current
trail ferry
#

lol , help getting help

ember ledge
#

Hey guys does anyone know how to use socket to host a python script via TELNET?

edgy pelican
#

TELNET?

#

the last time i saw that word was like

#

never

quartz frigate
#

!docs telnetlib

errant bayBOT
#

Source code: Lib/telnetlib.py

Deprecated since version 3.11, will be removed in version 3.13: The telnetlib module is deprecated (see PEP 594 for details and alternatives).

The telnetlib module provides a Telnet class that implements the Telnet protocol. See RFC 854 for details about the protocol. In addition, it provides symbolic constants for the protocol characters (see below), and for the telnet options. The symbolic names of the telnet options follow the definitions in arpa/telnet.h, with the leading TELOPT_ removed. For symbolic names of options which are traditionally not included in arpa/telnet.h, see the module source itself.

quartz frigate
#

Though it will be removed next year

quartz frigate
#

BRO

#

you’re missing out

edgy pelican
edgy pelican
#

yep thats me

quartz frigate
edgy pelican
#

no thanks

#

i dont trust telnet

quartz frigate
#

_your loss _

edgy pelican
hybrid coyote
#

Hello

#

I've been looking around, I have a bunch of questions

  • Let's say you're using sockets and threads to allow LAN communication across devices connected to the same wifi network, how much different would it be to set up the same thing but using WAN/across the world, so you could set up some communication between clients from anywhere. i.e, something like port forwarding?
  • I read the pins regarding port forwarding, seems to be more mechanical than to integrate with software/games. Is using a hosting service really required when port forwarding? I'm not against it, but isn't it possible to say allow each client to host servers so other clients could join the room/lobby/server? Or does that still require a hosting service as a middle man
  • I'm wondering if there are any code-based tutorials on port forwarding with python, unfortunately Googling didn't help much, nor YouTube or GPT. Seems to be obscure . I did find these though - Neural Line (in pins) but again it seems to be LAN, Random Github repo with 100 stars Cool but I'm looking for an explanation/tutorial so I can swap things around
  • Would you say it takes a lot of networking background to get something like port forwarding set up, or would a novice like myself be able to hack something together without too much stress. I'm comfortable with Python, very limited in the scope of networking though
zealous flint
# hybrid coyote I've been looking around, I have a bunch of questions - Let's say you're using s...

You need to expose your internal network to the wider internet if you want people outside your internet to connect to your server. It's like leaving your front door open.
What you decribed here is basically P2P (peer to peer):

I read the pins regarding port forwarding, seems to be more mechanical than to integrate with software/games. Is using a hosting service really required when port forwarding? I'm not against it, but isn't it possible to say allow each client to host servers so other clients could join the room/lobby/server? Or does that still require a hosting service as a middle man
And port-forwarding isn't really done code-side - it's more done on the side of the router.
For server/client stuff most people run it on a cloud host (since you don't really have to configure port forwarding, and a bunch of other advantages)

steady horizon
# hybrid coyote I've been looking around, I have a bunch of questions - Let's say you're using s...

Port forwarding is a necessary step. It's a setting in your router. I can access this setting in a webpage which is served by my router via its gateway IP address.
If you don't want to do it on your router or you can't, you use a hosting service which lets you do it.
Game rooms/lobbies are structured as sessions which the main game server knows about and notifies other players about. The sessions can be server programs running on a player's machine which is hosting the game session OR isolated units on the main game server (in a subprocess, in a different thread or whatever you can think of which works best for you). There are pros and cons for hosting sessions on the main game server vs on a player's machine

hybrid coyote
#

I understand, so the configuration is a necessary step. I'm assuming hosting on the players machine means their computer would need to be configured to allow port forwarding too. Then I guess a main server approach works better, but it probably requires some amount of payment one way or the other, hence making this seem less likely for me to do.

zealous flint
#

It's not too common these days I don't think

shy pebble
#

o/
Before I go off writing some scripts, is there some program I could use to test how my application handles timeout? That is, have it dripfeed bytes from some hex dump into the network/insert a 30s pause into the middle of the stream.

hybrid coyote
shy pebble
#

Ye, more or less free (except for the cost of the time you spend dealing with bug reports due to the many issues P2P has :P)

gloomy root
shy pebble
#

I just wrote some shell scripts with nc, xxd -r -p and sleep. Jespen is absolutely overkill for this.

oak tundra
#

is there any way for me to access account protected network locations using python?

Running the following:

open(r'\\server\d$')```
Returns:
```python
Permission Denied: `\\\\server\\d$`

Is there any way to pass an account?

oak tundra
hybrid coyote
shy pebble
# hybrid coyote If I'm willing to spend, what would the server costs be to run an API that handl...

That depends a lot on the playerbase - the more, the pricier, as well as on the complexity of the game. For some basic game, you could probably get away with a midrange VPS, so that's like 10-20 $ a month if you have ~100 players in various lobbies.
As for which VPS provider, hetzner and netcup are the two most recommended providers I hear about. I have also need some people experiment with using aws lambda style hosting for game servers, but that is a fairly new idea and I wouldn't recommend starting out with it.

#

if you really just have 2-3 lobbies at a time, you could be fine with just some random free-tier VPS from your cloud provider of choice

hybrid coyote
#

Hmm alright, thank you. Unfortunately free tier services still require credit cards to hold a bit of money(around a dollar) to verify identity, so if I'm paying I might as well go through with it

gloomy root
#

most if not all providers require that

#

they are a business and often they do refunds within the first 14 days which would be very easy to abuse if you didnt force card verification

finite bay
#

I need guidance on how to connect to an smtp outlook 365 server using oAuth in Python.

zealous flint
#

At least, that's what my team does

finite bay
#

I am trying to authenticate

#
from O365 import Account
import os


def send_message():
    credentials = (os.getenv('ms_client_id'), os.getenv('ms_client_secret'))
    account = Account(credentials, auth_flow_type='credentials', tenant_id=os.getenv('ms_tenant_id'))
    if account.is_authenticated:
        print('Authenticated!')
    m = account.new_message()
    m.to.add(os.getenv('ms_email'))
    m.subject = 'Testing!'
    m.body = "This is a test"
    m.send()

What I have so far

#

account.is_authenticated evaluates to False

zealous flint
finite bay
rough knot
#

Can anyone help me with the client and server python program? I have built a C2 which is used to scan for malicious activity in PCs in an active directory but my client side program isn't working properly when i try to connect with Windows vm.

lament veldt
#

Any good resources to learn Computer Network lesson

crystal current
glad surge
#

How to get the code of an import?

#

Or maybe is there a documentation how to get new followers and donations on TikTok?

mild jasper
#

Does anyone have any suggestions how could I fix the following issue: Using requests the connections stall indefinitely but only inside WSL2 environment (Ubuntu 22.04.3 LTS). So if I do ctrl+c the code is always at:

  File "/home/hyvok/miniconda3/envs/air/lib/python3.8/socket.py", line 669, in readinto
    return self._sock.recv_into(b)

Probably related that I am using VPN

#

Networking inside WSL environment seems to otherwise work as expected and I am able to ping etc. the local machines I am trying to access via VPN

regal birch
#

hi , does the pythonping(https://github.com/alessandromaggio/pythonping) faster then the ping(https://github.com/torvalds/linux/blob/master/net/ipv4/ping.c) cmd tool of linux , or does my benchmarking strategy incorrect ? my bechmarking results shows 5 times faster , and linux ping is still making syn call , maybe its part of ping strategy , maybe it should provide a async flag
https://github.com/Agent-Hellboy/my-pen-on-python/blob/main/22_Nov_2023.md
can somebody check both the codebase and tell me why?

GitHub

A simple way to ping in Python. Contribute to alessandromaggio/pythonping development by creating an account on GitHub.

GitHub

Linux kernel source tree. Contribute to torvalds/linux development by creating an account on GitHub.

GitHub

Contribute to Agent-Hellboy/my-pen-on-python development by creating an account on GitHub.

edgy pelican
#

the linux ping tool waits until it has a response and waits for a bit before sending the next ping

#

the pythonping is continuous

#

think of it like this

pythonping:

         20x
client ------------------- server

linux ping

            20x
|--------| ------------ server
| client |               /
|--------| -------------/```
#

of course its fatser, it doesnt have to wait for anythign

bright meteor
# edgy pelican think of it like this pythonping: ``` 20x client ------------------- s...

if you use the flood mode, ping changes behaviour

-f Flood ping. Outputs packets as fast as they come back or one hundred times per second, whichever is more. For every ECHO_REQUEST sent a period “.” is printed, while for every ECHO_REPLY received a backspace is printed. This provides a rapid display of how many packets are being dropped. Only the super-user may use this option. This can be very hard on a network and should be used with caution.

unreal sundial
#

Is there a Twisted discord server?

#

Twisted's own udp server / client doesn't work. seems kind of crazy but, doesnt work on windows

#

running echoserver_udp and then echo_clientudp doesnt do anything?

fervent thunder
#

i can ssh (from an internet-connected device) into one that's not connected to the internet

#

how would i share the internet connection over ssh?

#

so, this would be like making the first device a proxy to the ssh server

edgy pelican
#

actually no

#

ignore that that was sleepy me being dumb

hard apex
#

Anyone got any experience with mininet-wifi?

crystal current
fathom walrus
#

Suppose you need to connect to the internet, and have 3 unstable/low-quality wifi connections available to you. Is there some sort of software that automatically connects to whichever source is more stable/high-quality, or simultaneously connects to all three and switches according to stability/quality?

crystal current
# fathom walrus Suppose you need to connect to the internet, and have 3 unstable/low-quality wif...

If you have multi WiFi cards you can probably aggregate them, depending what OS you are on: https://superuser.com/questions/1025471/using-two-wireless-nics-at-the-same-time-on-windows-10-desktop-pc

fresh gull
#

Hi, can anyone help me with socket library differences in python and javascript

#

since websocket and socket are different things wanna know if javascript has a library for socket and not websocket

steady horizon
#

I already explained this

fresh gull
last tiger
#

hi

#

is anyone online

abstract hinge
#

Hello everyone! Who wanna code together for kaggle?

twin bough
#

Hey what is recommended websocket client lib to use?

supple quiver
#

Hi everyone, is there anyone experienced with DTLS handshake with PSK and Cipher Suite who would like to help me? I'm not well versed in networking I know a little bit but not enough to go into RFC and do the building/wrapping of the packet itself.

dense ibex
#
imap_server = "imap.gmail.com"

# create an IMAP4 class with SSL
mail = imaplib.IMAP4_SSL(imap_server)

# authenticate
mail.login(username, password)

mail.select("Inbox")

# getting uids based on labels
status, data = mail.uid("search", '(X-GM-LABELS "Inbox/Vendors Affiliates")')

print(data)
#output
[b'56987 61298 61320 61725 61807 108724']

What encoding is used here?
How do I get uids from the bytes?

fathom walrus
#

if a Linux server's public IP keeps changing how the heck do I SSH to it

fathom walrus
#

can I somehow use a domain name to fix this?

coarse summit
steel agate
#

Hey if anyone here wants to participate in a hackathon, please let me know, my company is organizing a hackathon soon for python developers, DM if you are interested.

fathom walrus
#

thanks for the references!

coarse summit
#

np

edgy pelican
coarse summit
#

for the renewing part, I've just automated it

edgy pelican
edgy pelican
coarse summit
#

not a big issue to me tbh

edgy pelican
#

ok you do you

coarse summit
#

because then i'd understand

edgy pelican
coarse summit
#

mb then it completely makes sense

edgy pelican
#

and *.hello.duckdns.org points to your ip

#

for example you can do passwordmanager.hello.duckdns.org for your passowrd manager, vpn.hello.duckdns.org for vpn, ...

coarse summit
#

interesting

edgy pelican
#

something that noip doesnt do

coarse summit
#

but then it is only 1 domain name with subdomains