#networks

1 messages ยท Page 10 of 1

hasty quest
#

They are pieces of different information.

#

IP and TCP exist for different purposes.

#

IP provides the ability to send data across networks in general

#

and TCP provides some structure to data. The TCP data has to go inside the IP data to work.

#

Packets are dealt with at layer 3 and segments are dealt with at layer 4. That is the difference.

waxen rover
#

So it's like two different packets for a type of data or just on different levels??

#

Thanks for help @hasty quest

hasty quest
#

Packets are a layer 3 structure

#

Segments are a layer 4 structure.

waxen rover
ember ledge
#

does anyone know how to use vs code's port forward feature with python socket

#

im having issues with that

waxen rover
cloud spruce
#

we kind of solved it in a help post instead, it turns out that the port forwarding feature in vscode appears to only allow http/https much like the free Cloudflare Tunnel service and that they are quite similar, but this one is more for development and built in to vscode

ember ledge
#
import requests


session = requests.Session()
headers = {
    "Content-Type": "application/x-www-form-urlencoded",
    "Authorization": "Basic eHl6YTc4OTF6clRYTllNbhbbbbbbbbbbbbh"
}

data = {
    "scope":"basic_profile:friends_list:presence",
    "grant_type": "client_credentials", 
    "password": "vgutgvu@123",
    "username": "fyccccc"

}

response = session.post("https://account-public-service-prod.ol.epicgames.com/account/api/oauth/token", headers=headers, data=data)

print(response.text)

headers = {
        "Authorization": "bearer "+response.json()["access_token"]
}
uer = session.get(" https://account-public-service-prod.ol.epicgames.com/account/api/public/account/displayName/vghhgv",headers=headers)


print(uer.text)
#

error:

#
{"errorCode":"errors.com.epicgames.common.missing_permission","errorMessage":"Sorry your login does not posses the permissions 'account:public:account READ' needed to perform the requested operation","messageVars":["account:public:account","READ"],"numericErrorCode":1023,"originatingService":"com.epicgames.account.public","intent":"prod"}

torn sable
#

I have this thing, where one client can send any number of packets and I forward them to a known set of clients after modifying them. The client can also send a quit packet and in that case the client has decided to leave.

Now, If I selectors.select on a socket that has EVENT_READ and I try to read it after doing a .setblocking(False) I read nothing since it always raises a BlockingIOError. And say I block on the first read_packet (because obviously something has to be there) I still am unable to read anything (blocks indefinitely). I am wondering if I've got the wrong idea about setblocking

#

I've spent the better part of today debugging this, and now the exact moment when I decided to ask for help I put a sleep(0.5) before doing a read operation and it has decided to work again?
I'm not sure if there's some troll in my computer,

#

How does a sleep(0.5) make any sense?

cloud spruce
# torn sable https://paste.pythondiscord.com/KQMQ

i don't know what you are doing as i have only skimmed your code quickly
i've done non-blocking network io with select/selectors (at different times), but then i just make the sockets non-blocking at creation and then leave them like that for the rest of their lifetime
or with threading i just create a new thread per connection that needs reading and i do the reading blocking, sure you could probably do a thread pool and combine it with non-blocking io but i never needed too
why back i've even done multi-processing for client connections instead of threads, but i can't recommend that in general
nowadays i most often use asyncio instead and call a coroutine per connection that needs reading

torn sable
#

I'll give asyncio a try. For this problem my guess is that a blocking socket.sendall is a lie and it doesn't actually block until it sends all the bytes out and internally does some shenanigans, need to check.

Spinning a thread to do blocking reads and having some shared list of read and written packets seemed a bit heavy weight and perhaps more complicated than it needs to be.

cloud spruce
# torn sable I'll give asyncio a try. For this problem my guess is that a blocking `socket.se...

to get a bit more technical, the OS has an independent trasmit buffer and receive buffer per connection and as long as the transmit buffer is not full send() will return almost instantly

the transmit buffer can fill up if the other side isn't acknowledging the packets that our system sent or if the other systems kernel starts sending us zero window packets telling us to hold sending any more data for the time being
this can happen if there is a communication problem between the two systems respectively it the receive buffer on the other system gets full due to the application on the other side isn't reading the data fast or often enough from that systems receive buffer (or at all if it has become stuck on some other task)

but it is far more likely that a blocking recv() call would get your application hanging when there is no further data to read

torn sable
#

Interesting, thank you for your insights!

ember ledge
#

how can i make 2 PC connect each other on different networks with server and client

#

i tried with UDP and TCP

#

it doesnt works

undone timber
#

Use TCP

#

To connect from different networks u can actually use sockets in python

undone timber
#

but the problem is that if u r trying to connect from a different network u have to configure the router to allow connections for a perticular port

#

if the computer is not directly exposed to the internet

ember ledge
#

@undone timber issue is im trying to open server from my VDS

#

my VDS says UDP is Activated

#

thats why i tried with UDP

undone timber
#

oh ok

#

idk why it doent work then everything seems fine ig

hollow gulch
#

hey anyone knows zeroconf well ? dm me pls

twilit prairie
#

Im not really sure how to do or where to send this so Im just gonna send this in multiple channels, but redirect me to the correct one if im wrong, I wanna make a micro controller / ardiuno where you plug it into a router and it automatically spits out all the people on the network into a file, how would I do this? and what materials / tech should I use

edgy pelican
#

you mean an ARP?

twilit prairie
#

like device names

crystal current
hushed tangle
lethal bear
#

question
why does this happen?

#

when I do 0.0/24 not every device pops up
but when I do 0.1/24 every one does

still geode
#

oye

misty orbit
#

would appreciate a lot some help :7

coarse summit
#

if it's just for lan you don't need nginx as long as it is in the same network

brazen rune
#

Hey, I know it is not directly related to Python, but I have a problem with connection on my Hetzner VPS server. It is a Fedora 39 with just a few packages downloaded. I wanted to deploy the simplest to-do list but when I wanted to clone repo I encountered this error - git clone https://github.com/Zimzozaur/TDD_Django.git
I received the following error message:

Cloning into 'TDD_Django'...
fatal: unable to access 'https://github.com/Zimzozaur/TDD_Django.git/': Failed to connect to github.com port 443 after 133525 ms: Couldn't connect to server

Also Ping does not work

What can cause this problem?

crystal current
#

Your firewall rules are ipv6 only, you probably need ipv4

raven locust
#

Hellow i have network like this
DHCP server(mikrotik)->DHCP server(ubuntu)->mikrotik ->client
I want my clients get ip from dhcp client from ubuntu but while i test i sometime clients get ip from dhcp server in mikrotik

Now how to block dhcp request to DHCP server in mikrotik using Ubuntu

crystal current
ember ledge
#

can anyone please explain to me how to count the number of networks in a topology?

#

ping please

crystal current
ember ledge
raven locust
crystal current
hexed galleon
#

n = 0
while True:
b = []
n_s += 1
n= n_s
print(n)
while n != 1:
if n % 2 == 0:
n = n / 2
else:
n = n * 3 + 1
if n in b:
print(str(n)+'!!!!!!!!!!!')
else:
b.upeend(n)

upper ibex
#

.

sturdy bloom
#

hello

celest notch
#

Hello there,

I am looking for some tips and tricks regarding the management of states in the socketserver.StreamRequestHandler class in python.
I trying to couple the handle method from the RequestHandler together with the design-pattern for statemachines.
I am looking at https://refactoring.guru/design-patterns/state for inspiration on how to organize it.
What are the best practices ?

class RequestHandler(socketserver.StreamRequestHandler):
    def __init__(self, Elf, *args, **kwargs):
        self.Elf = Elf
        super().__init__(*args, **kwargs)

    def handle(self):
        
        # Receive the message type
        data_bytes = self.request.recv(1024)
        # Decode bytes to a string and convert it to a dictionary
        payload = json.loads(data_bytes.decode('utf-8'))
        # Access msg_type from the dictionary
        msg_type = payload['type']
        if msg_type == MSG_TYPE.SANTA._value_:
            self.handle_santa_msg(payload)
        elif msg_type == MSG_TYPE.FEELER._value_:
            self.handle_feeler_msg(payload)
        elif msg_type == MSG_TYPE.ACKNOWLEDGEMENT._value_:
            self.handle_acknowledgement_msg(payload)
        elif msg_type == MSG_TYPE.READY_REQUEST._value_:
            self.handle_ready_request_msg(payload)
        elif msg_type == MSG_TYPE.READY_RESPONSE._value_:
            self.handle_ready_response_msg(payload)
        elif msg_type == MSG_TYPE.REJECT._value_:
            self.handle_reject_msg(payload)
        elif msg_type == MSG_TYPE.START_OVER._value_:
            self.handle_start_over_msg()
vagrant bay
#

what kind of protocol do traffic signals use

#

the common answer i usually get is NTCIP

#

just wanted to know if thats what they use in industry solutions

crystal current
prisma cobalt
#

That way you'd only need to perform a single lookup and call the result

sacred gull
undone timber
#

yeah

undone timber
#

1 method can be is to use sockets and its built in functons to bind a socket(of server) to a port and connect the socket of the other computer to that socket(of server).

#

But for this u would need to configure ur router to let in tcp connections at your desired ports in the server side

undone timber
#

TCP is the best option

livid basalt
#

Could someone help me understand the inner workings of a 3 layered neural network during back propogation if we used cost function MAE and a sigmoid activation ( 1/(1+e^-x))? ๐Ÿ™

#

like how to calculate the gradient

#

๐Ÿ™

lyric oak
wintry musk
#

about http API, and upload of files: I've come accros multipart POST of files, but I was wondering: if I chose to put the file content into a simple post request, what would be the size limit of that file ?

wintry musk
#

well I don't see limitations so far

#

it works with ko files, it works with mo files

crystal current
# wintry musk about http API, and upload of files: I've come accros multipart POST of files, b...

I googled it for you, the answer is what I would have guessed, no enforced limit just the practical ones: https://serverfault.com/questions/151090/is-there-a-maximum-size-for-content-of-an-http-post

livid basalt
mellow knot
#

Hello I'm trying to get a lets encrypt ssl cert for a domain I got from linode to use with a python websocket server but keep getting this error:

root@localhost:~# sudo certbot certonly --standalone
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Please enter the domain name(s) you would like on your certificate (comma and/or
space separated) (Enter 'c' to cancel): websockettictactoe.co.uk
Requesting a certificate for websockettictactoe.co.uk

Certbot failed to authenticate some domains (authenticator: standalone). The Certificate Authority reported these problems:
  Domain: websockettictactoe.co.uk
  Type:   dns
  Detail: DNS problem: NXDOMAIN looking up A for websockettictactoe.co.uk - check that a DNS record exists for this domain; DNS problem: NXDOMAIN looking up AAAA for websockettictactoe.co.uk - check that a DNS record exists for this domain

Hint: The Certificate Authority failed to download the challenge files from the temporary standalone webserver started by Certbot on port 80. Ensure that the listed domains point to this machine and that it can accept inbound connections from the internet.

Some challenges have failed.
Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

Anyone know what I might be doing wrong? I did previously have a cert for this same domain working but lost that domain and created a new one recently with a different provider

heavy blade
#

can anyone help me print the latest email from a specific sender in imap ?

crystal current
# heavy blade can anyone help me print the latest email from a specific sender in imap ?
gentle trench
#

Does somebody have a good packet model with dynamic key and values?

#

My packet model is.

[
MAGIC,
Size Of Data,
Size Of Dictionary,
Dictionary (Contains null terminated keys and offsets to data after MAGIC_2),
MAGIC_2,
Data
]
cosmic thorn
#

any good tutorials for creating a network scanner in python?

hollow gulch
#

Hey guys, im making a client/server application, and rn im doing a ping function. The problem is that the client sends 'p0;', 'p' to indicate that it is for the ping, '0' so that there is at least some data, and ';' so that i can separate stacked data. The server receives it, but when its supposed to send it back so that the client can compare time, the client recieves 'c007;'. Any idea on what to do, to check ?

hollow gulch
#

Nevermind, it can only scan an ip to get the opened ports

gentle trench
hollow gulch
#

Idk, the issue seems weird, some compression/encoding problem, because nowhere in my code i have written 'c007', so im not sure what to do

rough walrus
#

does anyone know how to install pcapy module? pip install pcapy is not working

crystal current
rough walrus
vivid sorrel
#

best code i've ever used : import turtle

rough walrus
#

And suggested pypcapkit

exotic bramble
celest notch
#

Anyone got any experience with the Raft algo implementation PySyncObj library?

I am trying to remove the leader node from the cluster But it keeps giving me โ€œFAIL_REASON: request deniedโ€

winged pine
#

PLEASE ANYONE HELP, its my 7th time making a thread on this.

lyric oak
# winged pine PLEASE ANYONE HELP, its my 7th time making a thread on this.

It does require you to be very familiar with a native library like openssl and know exactly which methods to hook to so that you can interfere the handshake process. That's not a very common piece of knowledge (no doubt it was closed so many times). My advice is to hire someone experienced consultant.

winged pine
#

I figured out the issue

#

Thank you though @lyric oak

feral bane
sage knot
#

Hey Guys, does anyone know how to fix this code? I am trying to do a broadcasting sort of thing for a school year 11 science experiment.

crystal current
white lantern
#

i'm guessing they're referring to all the linter squigglies

sage knot
#

Yep

crystal current
# sage knot Yep

Hover on them to see what they're about. Or look for the error list at the bottom of the page

elder cobalt
#

@cloud spruce sorry for a long hiatus, unfortunately my HDD died ๐Ÿ˜“ any idea if you still have any bits or pieces of the code saved?

#

I'm currently going through all my old messages here

cloud spruce
zenith bear
#

I havent touched coding in days

#

I need to get back to it

elder cobalt
shadow mesa
#

hello
so i went to this place this moring and i wanted to know its IP adress how can i do it?

#

if i have its mail adress is there anyways i can find its IP adress?

cedar forum
#

not sure exactly what this question means

#

which IP address are you trying to find, their mailserver? and why?

shadow mesa
#

and all i have it there location

cedar forum
#

๐Ÿคจ

#

and why do you want this

shadow mesa
cedar forum
#

needs a good answer

shadow mesa
cedar forum
#

well you haven't given a use case that isn't malicious

shadow mesa
crystal current
pale gorge
#

It isn't. It doesn't work like u could find anybody's IP address and hack into their PCs

cedar forum
#

lol

#

this is just such a silly discussion

trim rock
#

i was bulding clint and server basic

#

i am getting this error on client side

#
  File "/home/anonymous/Documents/Items/codes/Python/client.py", line 9, in <module>
    socket.bind((host , port ))#send req to server
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
OSError: [Errno 98] Address already in use
#

it says address alredy in use even when i change my server "host" ip still it say address allredy in use dose it mean that port is busy or smth

trim rock
steady horizon
#

Just the server

trim rock
steady horizon
#

There's a connect method clients should use

trim rock
#

so it should be used by server only

#

to bind its ip and port with a socket i guess

steady horizon
#

For future records, make sure you close the sockets appropriately so you won't get an error saying the same just because little time passed and the system just waits idly by while some internal timer resets

trim rock
#

.connect should be used by client?

steady horizon
#

If it's TCP, yes

#

UDP sockets can too but it's not necessary

trim rock
#

can i close it through terminal .. is there any cmd

steady horizon
trim rock
steady horizon
#

As I understand it, you just have a server running

#

!d socket.socket.close

errant bayBOT
#

socket.close()```
Mark the socket closed. The underlying system resource (e.g. a file descriptor) is also closed when all file objects from [`makefile()`](https://docs.python.org/3/library/socket.html#socket.socket.makefile) are closed. Once that happens, all future operations on the socket object will fail. The remote end will receive no more data (after queued data is flushed).

Sockets are automatically closed when they are garbage-collected, but it is recommended to [`close()`](https://docs.python.org/3/library/socket.html#socket.close) them explicitly, or to use a [`with`](https://docs.python.org/3/reference/compound_stmts.html#with) statement around them.

Changed in version 3.6: [`OSError`](https://docs.python.org/3/library/exceptions.html#OSError) is now raised if an error occurs when the underlying `close()` call is made.
trim rock
#

yeha

trim rock
steady horizon
# errant bay

Or better yet, use the socket in a with statement so it does it for you and takes care of abrupt shutdowns

#

Like with files

trim rock
#

okie

#

understood

steady horizon
errant bayBOT
#

socket.connect(address)```
Connect to a remote socket at *address*. (The format of *address* depends on the address family โ€” see above.)

If the connection is interrupted by a signal, the method waits until the connection completes, or raise a [`TimeoutError`](https://docs.python.org/3/library/exceptions.html#TimeoutError) on timeout, if the signal handler doesnโ€™t raise an exception and the socket is blocking or has a timeout. For non-blocking sockets, the method raises an [`InterruptedError`](https://docs.python.org/3/library/exceptions.html#InterruptedError) exception if the connection is interrupted by a signal (or the exception raised by the signal handler).

Raises an [auditing event](https://docs.python.org/3/library/sys.html#auditing) `socket.connect` with arguments `self`, `address`.
steady horizon
#

There's a nice simple walkthrough in the docs

trim rock
#

yeha i see

steady horizon
#

I think it's called sockets HOWTO

trim rock
#

oh

trim rock
#

import nmap

scanner = nmap.PortScanner()```
#

gives the error

#
    import nmap
  File "/home/anonymous/Documents/Items/codes/Python/Netmaps/nmap.py", line 5, in <module>
    scanner = nmap.PortScanner()
              ^^^^^^^^^^^^^^^^
AttributeError: partially initialized module 'nmap' has no attribute 'PortScanner' (most likely due to a circular import)
โ”Œโ”€[โœ—]โ”€[root@parro```
#

even i did installed python-nmap through pip3 install python-nmap

soft forge
trim rock
trim rock
hasty quest
#

The socket on the client only needs to receive reply traffic from the other end of the connection, so this isn't required.

#

The server on the other hand needs to deal with requests to establish new connections, so the ways in which the socket should be reachable can't just be inferred.

#

e.g. if you bind to 127.0.0.1 then it will not accept incoming connections over the LAN, only local connections.

#

If you bind to 192.168.1.1 then it will accept LAN connections but not local ones (assuming that is a valid IP for the server on the LAN)

trim rock
#

Thaks you so much I understood ๐Ÿ™

autumn roost
#

hi

exotic bramble
cloud spruce
# trim rock Oh

if you instead bind to 0.0.0.0 it will work for any ip and interface on your computer (i.e. both localhost and lan), just be aware that if any other process binds to specific ip address on the same port, they will get all those connections instead

cloud spruce
edgy pelican
#

::1 is for IPv6 iirc

chrome seal
#

yo can i leak the persons ip adress who tried to hack my acc???

white lantern
#

not in compliance with the policies of discord or this server, no

undone timber
spiral ibex
#

i was testing a few things with flask on my vps and i suddenly see this

#

what is this?
btw the flask app is running on 0.0.0.0 and i havent shared the flask link with anyone except on my own private discord guild with no members except me

#

or should i ask this on the cybersec channel? idk if this is related to that tho

spiral ibex
inland rampart
#

what ip?

spiral ibex
#

U want it?

cedar forum
#

it's likely just a scraper

#

you don't have to share links for things to be public/reachable, as soon as your web app is open to the internet it really is that

#

your VPS will likely be getting hundreds of attempts at SSH/HTTP per day from random IPs from all around the globe and from all sorts of providers

cedar forum
#

by scanners, trying to break into your server

#

generally they are other compromised servers or specifically set up servers

#

as long as you configure SSH and your firewalls correctly, you are fine, but never assume anything that you have an open port to is "private"

spiral ibex
#

The only 2 ports i have open are 22 and 8080
One for ssh and one for apps like flask whenever im testing

#

Also thanks for the reply good sir

cedar forum
#

yep that's fine -- just make sure they are secure, set a good password (not "password"), and you're fine, but don't be too surprised if random IPs stumble across your IP

copper cloak
#

anyone have a sec to help me understand a bug I'm running into with getting certificates with sockets?

copper cloak
cedar forum
# copper cloak Oh is this not a help section?

it is, I think dowcet just meant that if you describe your problem it's more likely that someone who knows things will be able to see it and answer ๐Ÿ˜„, if people don't know the specifics they are unable to think they can help

copper cloak
crystal current
copper cloak
urban vapor
#

I have a client and server application (socket) that periodically send each other the status of the application they're running in. Now I want to synchronously execute some procedure between them with a series of synchronous send/recv calls. My problem is, when I send the send(PROCEDURE_INIT) the following recv() might not be the response I expect, and instead be one of the periodic status updates the client hapened to send at that time.

What is a good way to sync the two back up so I can run some procedure in lockstep again? Any tips or resources? (no 3rd party libraries)

vale raptor
# urban vapor I have a client and server application (socket) that periodically send each othe...

im no expert, but you might want to design your protocol in a way that lets you process the stream into a sequence of events, regardless of the order they come in

https://sans-io.readthedocs.io/how-to-sans-io.html
writing a sans-IO implementation can make it easier to manage this, for example you might have a Client with a receive_bytes() method, where you pass the data you receive from the server and it returns a list of events that were able to be parsed (buffering any incomplete data)

#

afterwards you can have a receiver thread/task feed it data and handle the resulting events, such as waking up another task when a particular procedure has been acknowledged by the server

winged pine
#

need some help

winged pine
#

need some help again

brazen rune
#

XD i can share but headphones does not work

winged pine
tawdry tulip
#

i like your pfp :)

glad roost
#

Anyone know how to use SQLite with JavaScript in a browser?

crystal current
glad roost
#

but how do I add it to my project?

prisma cobalt
lost wigeon
#

Hi i am here to looking for advice on a project where I want to build a http server from scratch on python is there any good guide or book or any kind of advice will help
Thank you

lost wigeon
crystal current
bold wyvern
#

What's recommended for game-making? Currently trying python sockets but i'm struggling to send objects from one client to another and to the server...

shy pebble
bold wyvern
#

do you reckon JSON is just better for this than sockets?

lost wigeon
bold wyvern
#

I have no experience in networking so this is my starting project

lost wigeon
bold wyvern
shy pebble
#

in that case, I would probably suggest learning sockets on more generic projects then using that knowledge for a game.

bold wyvern
#

i've made games before but none multiplayer or online

lost wigeon
shy pebble
#

They aren't too complicated, but there is sort of a baseline level of knowledge you need to actually be successful

bold wyvern
#

Alright, thank you

#

I'm guessing there's a difference between sockets and socketIO?

lost wigeon
#

Socketio is like a wrapping for socket it's much easier to use

shy pebble
#

yes, socketIO is a higher level networking thing, it should do fine for games.

bold wyvern
#

Yeah i just searched it up, i will start learning it

#

Ty guys

edgy pelican
#

socket is pain

#

(with tcp btw)

#

sometimes

#

it mixes up the order of the packest

#

sometimes

#

it smushes them together

#

sometimes it just doesnt wanna work

lost wigeon
#

I know right and you have to write it multi thread manually when io is built in

torpid basalt
#

i think this is the correct channel to ask

#

sorry its wrong

#

can a old laptop run python

#

i have a ryzen 2500u laptop

#

about 9 years old

#

or should i upgrade

vale raptor
torpid basalt
#

thank you

terse meteor
#

oh okay, nevermind i found another site that's an API with the data i need

terse meteor
cedar forum
terse meteor
#

ah, they don't seem to list a terms of service

lyric oak
# lost wigeon In this we are using socket but I want to learn the http protocol how can i buil...

That's an interesting question from you, but from scratch isn't something feasible. You won't be able to implement your own TCP stack or HTTP stack easily as previous work took weeks to finish and years to stablize. IETF has RFC documents for HTTP 1.0/1.1/2/3 but they are for experienced audiences and also lack of certain details to guide you to implement your own. That's overall why people tend to use existing libraries.

lost wigeon
clever sparrow
#

How do I create a server script that responds to concurrent connections?

dull edge
#

my script sends out different requests every minute

#

in the last about 2 weeks ive had this twice where i can't start a flask server giving me an error something like the port is taken

#

but it's not

#

then i can't send http requests, instead i get httpcore.ConnectError: [WinError 10055] An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full

#

i can google search and use discord and all that but i can't click a link and go to like reddit instead it gives me a network error

#

once i restart my pc it all goes away

#

im not 100% sure this is something with my python script but it seems like it

inland rampart
#

huh, and killing your program doesn't fix it?

dull edge
#

first result when looking it up is this

#

port exhaustion

#

could explain why a few requests still work but probably less than 5%

inland rampart
#

the issue is that.. well, a well-behaved requests library shouldn't leave open ports at all unless killed in the middle of a request, but more importantly the OS should reclaim them after the process is dead, and it's very weird if that isn't the case. perhaps check for orphaned proceses: https://serverfault.com/a/273727

ember ledge
#

!d discord webhook to website connection

#

!d next

dull edge
#

i wonder if i could recreate it

#

and since this is running for over a week it could be having a few fail here and there and it just builds up

hot hollow
#

sorry my problem might not so related to the network.

I try to get the picture from ebook-mirae-n.com,but even I use seleium, I still cant get web info.
Is anyone know how to get the picture from this web-site?

from selenium import webdriver
from selenium.webdriver.chrome.service import Service as ChromeService
from webdriver_manager.chrome import ChromeDriverManager

opt = webdriver.ChromeOptions()

driver = webdriver.Chrome(service=ChromeService(ChromeDriverManager().install()),options=opt)
url = "https://ebook.mirae-n.com/@kb2072/319"
driver.get(url)
driver.implicitly_wait(1)
page_source = driver.page_source
print(page_source)
driver.quit()
clever sparrow
#

How do I write tests for scripts and error handling, please?

clever sparrow
prisma cobalt
clever sparrow
#

I have a server script and I want to protect it from attackers. How do I go about it while handling buffer overflows and other potential security issues, and implementing SSL authentication between theh server and the client, using either a self-signed certificate or PSK as the authentication method? Any directions to resources will be much appreciated

vale raptor
warped musk
#

How do I go about it while handling buffer overflows and other potential security issues

#

Use Rust /s

edgy pelican
cedar forum
#

depending on how you are structing things you can get i guess "meta" buffer overflows

#

but it's more just index errors because user input caused you to go past the bounds of a list

warped musk
#

python is interpreted, so all actual vulnerabilities lie in the runtime

edgy pelican
#

too lazy :P

warped musk
#

to... search the exact string with minimal research effort?

#
Python 3.x through 3.9.1 has a buffer overflow in PyCArg_repr in _ctypes/callproc.c, which may lead to remote code execution in certain Python applications that accept floating-point numbers as untrusted input, as demonstrated by a 1e300 argument to c_double.from_param. This occurs because sprintf is used unsafely.
edgy pelican
# lost wigeon Thanks
edgy pelican
#

welcome to rfc hell!

#

i mean, have fun

lost wigeon
#

Sure ill try my best

edgy pelican
#

poor soul

lost wigeon
#

Can I dm you If i get stuck?

cloud spruce
# lost wigeon In this we are using socket but I want to learn the http protocol how can i buil...

you can learn the http protocol and implement it using socket just fine and you'll still be low level enough for implementing that whole protocol layer yourself
if you don't want to use sockets you would need to use raw sockets and implement the tcp and ip stacks yourself, that will be a much bigger endeavor, (more on that below)

just start with https://datatracker.ietf.org/doc/html/rfc1945 for HTTP/1.0 as Evorage suggested earlier even if it's kind of an outdated protocol by now (or even first start with the unofficial predecessor later dubbed HTTP/0.9 at https://www.w3.org/Protocols/HTTP/AsImplemented with an example at https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/Evolution_of_HTTP#http0.9_โ€“_the_one-line_protocol) so that you don't get sidetracked and end up in a much deeper rabbit hole, if you want to get anywhere anytime soon and not just be reading hundreds of pages of RFC documentation on the full Ethernet, IP and TCP stacks with helper protocols such as ICMP and ARP (and more, it will branch out fast)

lost wigeon
cloud spruce
#

and did you implement the full spec or just parts of it?

lost wigeon
#

I used socket and i responses with 1.1 in the header. the only thing im familiar with is use socket listen in host:port and response with it

#

I don't think it's full slec
I listen if the path is in route response with that route functions or send a 404 page just that it can response with json data or a html page

#

No dynamic template system just a simple page

cloud spruce
#

what i'm talking about is much more low level and closer to the protocol layer than content types and content or even path matching
i'm talking about the HTTP RFC specification, the protocol itself that you said that you wanted to learn more about
that would be: parsing the request line, correctly handling different request methods (and give the correct type of error if it's not one of the supported ones), parsing headers and handling the request correctly depending on the different headers and their meaning according to the specification and such

#

the HTTP/1.1 specs are really extensive, with things connection reuse for multiple requests (handling the Content-length header or the little bit more advanced chunked encoding), it's a pretty big jump up from HTTP/1.0 (even after adding the unofficial but widely supported Connection: keep-alive extension to handle multiple requests over the same connection)

lost wigeon
sullen ether
#

Available subnet: 192.168.4.0/24
Create 3 subnets with 2 hosts

I'm confused. How do you solve this?

opal skiff
#

Good day. One question Please. I am using python CAN (https://python-can.readthedocs.io/en/stable/index.html) for sending and receiving messages. I have been trying to send messages. What I am doing is using the library to send a message and write the characteristics of that message on a CSV doc. The code I have used is the following:

#!/usr/bin/env python

import time
import can
import os
import csv
import pdb

os.system('sudo ifconfig can0 down')
os.system('sudo ip link set can0 type can bitrate 125000')
os.system('sudo ifconfig can0 up')

def main():
    with can.Bus(interface='socketcan', channel = 'can0',receive_own_messages=True) as bus:
       
        #print_listener = can.Printer()
        #pdb.set_trace()


        print_listener = can.CSVWriter("in.csv")
        can.Notifier(bus, [print_listener])
        bus.send(can.Message(arbitration_id=1,data=[1], is_extended_id=False))
        bus.send(can.Message(arbitration_id=2,data=[1], is_extended_id=False))
        bus.send(can.Message(arbitration_id=3,data=[1], is_extended_id=False))

        #message = bus.recv()
        #print(message.arbitration_id)

        time.sleep(1.0)
        print_listener.stop()
        bus.shutdown()
        
if __name__ == "__main__":
    main()

The thing is that it writes what it should ib the CSV, but when seeing the signal in an oscilloscope, it send infinite messages. Any hint on how to just send the messages I want /(not infinite messages), would be appreciated.
Thanks a lot in advance

cloud spruce
# sullen ether Available subnet: 192.168.4.0/24 **Create 3 subnets with 2 hosts** I'm confused...

that is a strange description of an "assignment", maybe they mean to say "create 3 subnets with 2 hosts each"?
historically the smallest usable network would be a /30 link network with a network address, two device addresses and a broadcast address
but for many years there is a special case where you can use a /31 link network with only two device addresses and which discards the notion of a network address and broadcast address specific for that network

cloud spruce
opal skiff
#

Thank you @cloud spruce , will do!

storm onyx
#

im using paramiko and not getting any output on the commands i run

cloud spruce
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.

storm onyx
#

is there an issue with bpaste?

#

that is just the default for wgetpaste

#

i got it wokring anyways, i think it wanted shell mode

sullen ether
sullen ether
#

Available subnet: 192.168.4.0/24

  1. Subnet for 50 hosts
    Subnet mask: 32 (original) + 6 = /28
    Subnet size: 256 - 64 = 192
    Starting address: 192.168.4.0
    Ending address: 192.168.4.63
    Subnet: 192.168.4.0/28

  2. Subnet for 24 hosts
    Subnet mask: 32 + 5 = /29
    Subnet size: 256 - 32 = 224
    Starting address: 192.168.4.64
    Ending address: 192.168.4.95
    Subnet: 192.168.4.64/29 <-- This is wrong right? The subnet mask should be /27? @cloud spruce

edgy pelican
#

i havent even gone anywhere near tcp/udp/http and im already stuck in the endless rabbithole

cloud spruce
errant bayBOT
#

Source code: Lib/socket.py

This module provides access to the BSD socket interface. It is available on all modern Unix systems, Windows, MacOS, and probably additional platforms.

Note

Some behavior may be platform dependent, since calls are made to the operating system socket APIs.

Availability: not Emscripten, not WASI.

This module does not work or is not available on WebAssembly platforms wasm32-emscripten and wasm32-wasi. See WebAssembly platforms for more information.

storm onyx
#

im running into more paramiko issues, it seems to be sending partial data

#

im using sendall, not sur why it's failing or how i can fix this

#

only 20 characters seem to be sent

#

weirdly it's also sending a \r\n?

#

i mean the system shouldn't even take it if it's missing \r\n, but it seems to pretend the whole line was sent and i can see it's setting partial data

#

like the username is cut in half

timid garden
#

hey if i want to do a post request on a site with the requests lib and the request's payload has a captcha is there any way for me to get that captcha code?

cedar forum
#

what is your use case

#

this sounds very not allowed

#

!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.

timid garden
cedar forum
#

there is a chance it might not be right lol

#

what are you trying to do

timid garden
#

nevermind i made a help post but apparently doing such things is against rule 5

errant bayBOT
#

:incoming_envelope: :ok_hand: applied timeout to @grave ingot until <t:1713542123:f> (10 minutes) (reason: newlines spam - sent 127 newlines).

The <@&831776746206265384> have been alerted for review.

solid bluff
#

!unmute 1180761894290718842

errant bayBOT
#

:incoming_envelope: :ok_hand: pardoned infraction timeout for @grave ingot.

solid bluff
#

!paste

errant bayBOT
#
Pasting large amounts of code

If your code is too long to fit in a codeblock in Discord, you can paste your code here:
https://paste.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.

solid bluff
#

use pastebin pls

ember ledge
#

It seems impossible to find a way to send video and audio stream from different network devices, I tried socket for same network for a start but I am not sure what to use to make it work

ember ledge
# cedar forum what are you trying to create

A web application for companies that do live streams, basically it will need to have access on current frame of the livestream and the audio for the last x seconds. Then frame and audio will need to be processed with some python and return a message based on the frame and audio, that message will then be written somewhere else with web automation tool (probably selenium python)

#

Since the web application have to be online 24/7 I need to have it on cloud and I found out about aws kinesis data stream

lyric oak
lofty bough
#

@ember ledge Can you stop the spam?

copper cloak
#

anyone know if I can make urllib3.HTTPSConnectionPool reject domains that don't support HTTPS rather than just silently downgrading to HTTP?

gentle trench
#

If you have a lot of tcp client connected, how would you broadcast some data to all the TCP client for the best efficiency?

crystal current
gentle trench
#

so just a for loop?

gentle trench
nova flower
#

is this the correct channel for paramiko questions?

ember ledge
#

I am trying to send RTMP from one device to another on a different network (I am using mobile data to recreate that in my house)

I have obs in my mac and I have this as settings:

stream_key: something_random```

Windows PC:
```rtmp {
        server {
                listen 1935;
                chunk_size 4096;

                application live {
                        live on;
                        record off;
                        push rtmp://x.rtmp.youtube.com/live2/[youtube_stream_key];
                }
        }
}```

I have also made a rule to accept all connections to port 1935 on windows

However when I press ```Start Streaming``` on macbook obs I get error: Failed to connect to Server
summer snow
#

Guys, does anyone have good documentation on the socket library

errant bayBOT
#

Source code: Lib/socket.py

This module provides access to the BSD socket interface. It is available on all modern Unix systems, Windows, MacOS, and probably additional platforms.

Note

Some behavior may be platform dependent, since calls are made to the operating system socket APIs.

Availability: not Emscripten, not WASI.

This module does not work or is not available on WebAssembly platforms wasm32-emscripten and wasm32-wasi. See WebAssembly platforms for more information.

steady horizon
nova flower
#

anyone familier with paramiko's check_channel_pty_request method

#

i need to enable it for a couple reasons but when i do, the users input from channel.recv is taken using bytes meaning letter by letter, this wouldnt be an issue since i can just log the bytes to buffer and then wait for new line to interpret the users full input, however i now face the issue of interpretting backspace, arrow keys, control c n whatnot so its going to be quite challanging as im pretty sure some terminals and operating systems have different codes for arrow keys... does anyone know a better way of doing this

red sun
#

Hii
I have published my project on IIS and it's working, but I want to run it on mobile , my pc and mobile is connect on same network, what to do?
Its running on 127.0.0.1 and port number 443
what to do
?

frank wolf
#

https://paste.pythondiscord.com/CFYQ
Fehler bei der Verbindung zur Datenbank: PostgreSQL server at "45.84.197.202:3306" rejected SSL upgrade
Warte 2 Sekunden, bevor die Verbindung zur Datenbank erneut hergestellt wird...

toxic mural
#

it looks like asyncpg is trying to create a SSL connection but the server doesnโ€˜t want to, or the other way around

frank wolf
toxic mural
edgy pelican
#

i thought

#

i was out of rfc hell

#

and now im right backc

frank wolf
#

i have fixx it but now they say the passwort is wrong but the passwort is working i used it self

Error connecting to the database: (1045, "Access denied for user 'root'@'45.65.115.85' (using password: YES)")
Waiting 2 seconds before attempting to reconnect to the database...

crystal current
lyric oak
ember ledge
earnest sinew
#

Anyone knows how to send malformed packets?

steady horizon
#

Try doing it as you would with well-formed packets and hope the other end doesn't automatically discard the packets

#

Like wdym

copper cloak
#

Hi all, wondering if I can get some help understanding where these errors that I'm dealing with are coming from and how to fix them?

[Errno - 2] Name or service not known
[Errno 111] Connection refused
[Errno 104] Connection reset by peer (this one writes "Killed" to the terminal and kills my entire program for some reason)

request function https://paste.pythondiscord.com/7TMQ

It appears that these errors are coming from the underlying library itself because they're not actually throwing python exceptions? They just print to the terminal. I'm also only getting these on specific domains and ip addresses.

lyric oak
copper cloak
copper cloak
lyric oak
copper cloak
#

I'm not sure if I'm asking you the same question in a different way, I'm just trying to understand this a little more

#

I think what I'm trying to ask is, I don't understand why receiving TCP RST kills my application.

ashen tinsel
#

on payload u can see the value of key2, which i observed and found out that everytime i authorise the value of key2 regenerates but i want to know in what pattern or from where it actually generates since it is different for every time i auth (doesnt change on which is it already authorised).

#

so how can i find from where or how it is generated

clever sparrow
#

I have a server script and it is already functional but now getting a little bit complex with new functions coming in, the newest of them all is to have different file search algorithms linked to a file path and to search for queries sent by the client, I don't wish to add more functions so as not to break it as I will only be adding the best benchmarked algorithm into the server.py, how do you suggest I go about it?

crystal current
bold wyvern
#

can anybody help me with sockets please?

#

i'm trying to connect two clients to the same thread of a game however i do not know how to write up the client side... the server side is fully working.

lyric oak
#

A socket client is very different from a game client, as the latter might involve a complex game protocol.

cloud spruce
steady horizon
#

Envisioned a protocol and stuff

earnest sinew
#

I am doing a penetration testing, suppose I have a web server and if I send a packet that the server is unable to process it would crash the server. But I can't reproduce this error

bold wyvern
bold wyvern
clever sparrow
crystal current
clever sparrow
#

Okay, thank you, I think I've gotten it now. Please, can I send you a DM? Also I wanted to ask, if I have a config file that reads if SSL is turned off or on on the server script, how do i go about that?

ember ledge
#

One message removed from a suspended account.

tidal scroll
#

Guys, I have a problem, I want to create connection with webpage and parse it, so I have this code:

    time1 = time.time()

    driver = Driver(browser="chrome", headless=True, proxy=proxy_host, page_load_strategy=None)
    driver.get("https://www.somepage.app")
    driver.add_cookie(
          {'name': '__Secure-next-auth.session-token', 
          'value': cookie_value, 
          'domain':'www.somepage.app'})
    driver.get(link)

    time2 = time.time()
    print('Step1 : ', time2 - time1)

    WebDriverWait(driver, 20).until(lambda driver: driver.execute_script('return document.readyState') == 'complete')
    
    time3 = time.time()
    print('Step2 : ', time3 - time2)

And here is the time consumption result:
Step1 : 4.481840372085571
Step2 : 3.3659958839416504

So on average it takes 8 seconds only to load the page, the question is how can I speed up this process as much as possible if I need js to be loaded on the page, because without this many elements I want to parse won't display?

median wraith
#

Can anyone help me understand signals and slots?

clever sparrow
#

Anyone has experience with fuzz testing?

gentle trench
#

Self signed, and CA-signed certificates provide the same level of encryption? The only difference is trust (whether the website is legit or not), right?

steady horizon
#

it depends on whether you trust the certificate authorities more than the server's self signed certificate

#

Self signed: trust me bro
CA signed: trust me bro, trust him

#

Certificates are about trust, not encryption iirc

cedar forum
#

they are about both

#

a HTTPS exchange starts with some assymetric encryption and then a symmetric key is agreed upon and used for the continuation of the dialogue

edgy pelican
cedar forum
#

speed & security

#

there is a reduced handshake length with TLS 1.3, 0-RTT

#

can be used in some cases as a replay attack vector, but used correctly, makes handshakes considerably faster

edgy pelican
#

huh neat

cedar forum
#

it's a lot of minor changes to the encryption suites used

edgy pelican
#

so it bundles in more data into a packet?

cedar forum
#

not really, it uses less packets to establish the same secure connection

edgy pelican
#

huh

cedar forum
#

but if you look at that website, there's some very interesting tidbits, how like TLS 1.3 pretends to be a TLS 1.2 session so that firewalls that are looking inside packets don't block packets because they don't recognise 1.3

#

it's all built to get through middleboxes without causing additional havoc, so it tries to change from 1.2 as little as possible

edgy pelican
#

ChangeCipherSpec is just "yep, i know what suite we're using" right?

cedar forum
#

yeah it's the switch from assymetric to symmetric

edgy pelican
#

neat

rugged ferry
#

note that this is not related to networks at all

ember ledge
#

a basic spoofing

rough viper
#

Hello everyone!
I wanted to know if it's possible to make payments automatically from a python backend (or C++, but it doesn't matter) and not selenium for greater speed or if it's clearly impossible due to potential security issues (which I have no idea about).
At the moment I've managed to create APIs for various things that involve POST/GET requests (particularly for LLMs like Microsoft copilot or other ) but never for requests involving payment, so I wanted to ask you about the feasibility of this.
Thanks ๐Ÿ™

ember ledge
crystal current
lucid jasper
#

Hi all,
Is it possible headless python os level automation ?

rough viper
#

But it is possible to do payment request on website like amazon from python backend ? Because it is faster than selenium

warped rock
crystal current
#

It's not that clear to me what you're actually trying to do though

rough viper
#

But thanks for the link

#

It also can be useful to buy sneakers faster than other people who use selenium

crystal current
rough viper
#

Ok I understand, I will search this alone, ty

wheat wedge
#

Hello guys , i am newbie at networking, I'm a student also , could you please give some free resources to learn networking from scratch?โœจthat would be great help for me

crystal current
lucid jasper
# crystal current Of course

I tried and research everywhere nothing found. I am working on project which device 1 force device 2 to format disk, install os, install drivers but there is one condition device 2 will be totally empty. And the whole process will be done using python language only.

#

I am still not sure this process is possible or not

#

Please suggest.

wheat wedge
crystal current
crystal current
# lucid jasper I tried and research everywhere nothing found. I am working on project which dev...

Oh I see. No, Python needs an OS installed first to do anything.

Once your machine is up serving SSH then you could install drivers with Python via Paramiko, but tools like Ansible are easier at scale.

If you need that level of infrastructure automation look into "infrastructure as code" frameworks like Terraform that can spin up a virtual server for you with a given image.

If you have more questions about that, #tools-and-devops is a better channel

wheat wedge
# crystal current I did... Professor Messer

Thank you , and i really interested in assemble gaming pc builds also , could you suggest any of the yt channel u known about oc builds and computer hardware all this stuffs?โœจ๐Ÿ’ซ๐Ÿ’ซ

ember ledge
lucid jasper
ember ledge
#

MAC Spoofing Detection Tool ๐Ÿฅณ

ember ledge
spare cobalt
#

I'm currently having a problem where I'm trying to connect to a remote server using SSH

They instructed me to connect using a VPN first using openvpn (they gave me a config file)

So I run sudo openvpn --config <config>.ovpn then i try to ssh into the remote server, after I enter my credentials the connection closes immediately

Also tried checking if my public IP ad has changed after using the VPN but my IP was the same

How do i troubleshoot this?

crystal current
spare cobalt
#

isn't my public ip supposed to change tho after I connect to a vpn?

crystal current
crystal current
#

I suppose it's possible that the server is on a public IP, letting you log in but dropping you because your IP is wrong, but that would be an unusual setup

hasty quest
#

VPN = Virtual Private Network

#

Contrary to what random people on Youtube will tell you, VPNs exist to transfer data into a private network without physically travelling there and plugging your computer in.

#

Not to watch Peruvian Netflix

#

Traffic only needs to be tunnelled through the VPN server if it needs to go to said private network

#

When you connect to Shit VPN (sponsor of today's video - use code REPENT, HARLEQUIN to get up to 15% or more off a 1-fortnight subscription), "traffic that needs to go to the private network" means any traffic NOT going to the VPN server itself, or like, your LAN.

#

So if you then google search "My IP," it gets routed using that policy

#

the VPN client then encapsulates your request and sends it to the virtual private network

#

where it gets sent through the network's default gateway and to Google

#

Google sees the originating IP as the network you sent it through and sends it back

#

There's no reason to send your regular public internet traffic through a VPN if you're using it for the actual Private Network part, instead of as a crappy single-hop traffic proxy.

#

So, when using a VPN that's not a youtube sponsor monetizing peoples' FUD about how Internets work, your normal traffic gets routed, well, normally.

crystal current
ember cypress
#

flosses

crystal current
split dust
leaden goblet
#

I have a problem revolving a connection between a mobile and my server in python

#

I can send and receive messages between the mobile and server tough the mobile recieves only the message sent by the server when i close the server. Does anyone know something realted I might be missing?

#

It sends only the first message i try to sent from the server

crystal current
leaden goblet
#

It's a string I'm trying to get sent by my laptop to my phone, they can be communicated but seems that the mobile receives the first string I sent when I stop the code running from the server.

ember ledge
#

hey guys, btw, I need a guest writer for my article where I share things like cybersecurity/coding/ML&AI, please dm if interested.

crimson wadi
#

I want to run a server on a seperate network so my own network has a smaller chance to get infested from the outside, could I add a seperate network next to my other networks in my household?

edgy pelican
crystal current
small mural
#

Have an issue of a website thatโ€™s aborting get requests for image zip files if my program throws too much work in a given time frame.

This prevents completing the task I was to automate given there are 100 thousand parts with images to pull down.

The only thing I think to do is switch my ip address so that server sees the requests as new calls.

Appreciate anyone thought on this issue.

Thanks

crystal current
frigid vault
#

I tried with sudo at the start and it didn't worked.

knotty warren
frigid vault
#

yes

knotty warren
#

That's why

#

Some root commands don't work even as root user inside of containers

frigid vault
#

It is ubuntu 24 so it shouldn't be any differed.

knotty warren
#

Those are probably because you do not have access to the main hardware to make those changes from inside the container I think

frigid vault
#

any alternatives?

knotty warren
#

Idk, I think stuff related to routing and related things have specific container commands

#

I don't really know much I am just guessing. I had this issue when I used docker

crystal current
frigid vault
#

Then how can I deal with it?

pallid topaz
#

And do you mean "time frame" as ratelimit? If so, just sleep between requests to avoid saturating your session

pallid topaz
#

I had that same issue with Golang, since I didn't close the connection

pallid topaz
# frigid vault help
small mural
#

Python documents socket functions not available when using the code. Using Windows 11 and Python 3.12.3

small mural
steady horizon
steady horizon
fair forge
#

so, as i know if a computer behind a firewall makes a request to a server outside the LAN the firewall trust it and let the incoming package from the server come into the computer right?
how can i configure this in python
to send like also a simple message
so i don't need port forwarding cause the main request was created by the client on the pc

pallid topaz
fair forge
pallid topaz
#

You can't, Python will only act as an intermediary for that, the router still won't allow the packet to go through

fair forge
#

so how can i send and receive packets?

pallid topaz
#

You can use Ngrok for that kind of things

#

Ngrok tunneling

fair forge
#

so why i donโ€™t need port forwarding like to play video games

#

like idk basic networking stuff

#

but how does it work iโ€™m also receiving packets

pallid topaz
#

Because you are not receiving the packet, you're sending it

#

To a WLAN port usually

fair forge
#

to visualize them

pallid topaz
#

Is Minecraft P2P?

fair forge
#

itโ€™s tcp i think

pallid topaz
#

If not, that's your answer

pallid topaz
fair forge
#

so protocols donโ€™t need port forwarding?

#

like i specify an address over the internet and it send the packet and the other people receive it?

pallid topaz
#

P2P = Peer to Peer
TCP/UDP are protocols that require open ports to send/receive packets

fair forge
#

so if minecraft is tcp he is port forwarding if i play a server

#

a stupid but effective example

pallid topaz
#

How the game interacts with the user and the server depends on the game itself, I couldn't explain how Minecraft networking works

fair forge
#

so basically to send packets i need port forwarding

#

nice

#

iโ€™ll tunnel

pallid topaz
#

Receive TCP/UDP packets, yes

#

Outside LAN

fair forge
#

thx for the advices

#

also can you provide me like a place where to learn more networking stuff like this

pallid topaz
fair forge
#

i see itโ€™s your sector

fair forge
#

i studied a bit and how can i hole punch with udp and sockets?

#

like why it doesn't work


#CLIENT N1
import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('', 5500))
sock.sendto(b'0', ("ADDRESS MACHINE 2",5500))
data, addr = sock.recvfrom(1024)
print(data.decode())

#CLIENT N2
import socket

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("",5500))
sock.sendto(b'0',("ADDRESS MACHINE 1",5500))

machine 1 starts before machine 2

small mural
#

Trying to solve why .recv is working intermittently

little breach
#

currently doing a cs degree and one of my units was networks

#

i was interested to buy myself a mini server and tinker around with it

#

is there anything i should know like do i need switches or can i just use my router and a server

cedar forum
#

generally you have one central public server, both your clients connect there, then the server tells each client the receive address of the other client

#

you can't just open a port and bind because the routers NAT will not forward traffic as you expect it to

steady horizon
crystal current
fair forge
fair forge
#

so even if i don't have a server in the middle the NAT shoul let the packet pass

little breach
#

But like hardware wise do I need something besides a router and a server?

#

If I wanted to host a minecraft world for example

crystal current
little breach
#

I was thinking of turning my pc into the server but I'd need it to be running every time to actually connect right?

little breach
#

So friends wouldn't be able to connect unless my pc is on?

little breach
#

yeah thought so

#

a main issue would be internet speed

#

i'd need to be basically using my internet to run the server right? which one would come with huge frame drops

#

would having a physical server acting aside from my pc fix that?

cedar forum
fair forge
#

nope on different networks

cedar forum
#

yeah that's why then

#

your local UDP socket probably has a port of like, 1.1.1.1:5500, but when it leaves your network, the NAT will rewrite that to the NAT port

fair forge
#

but i read that you can send like a ghost packet

cedar forum
#

the other client needs to send to that NAT port

#

you need a centralised server that is on the public internet that both tools can hit to do the holepunch

fair forge
cedar forum
#

which port, the NAT port? or the 5500 port that you've put in

#

the public port will not be 5500

fair forge
#

oh

#

so nat choose a random port yeah?

cedar forum
#

yes

#

that's why you need both devices to connect to a central server, then the server tells each client what the port is

fair forge
#

i need to know that port in order to reply to this ghost packet

cedar forum
#

this is exactly what https://en.wikipedia.org/wiki/STUN is for

STUN (Session Traversal Utilities for NAT; originally Simple Traversal of User Datagram Protocol (UDP) through Network Address Translators) is a standardized set of methods, including a network protocol, for traversal of network address translator (NAT) gateways in applications of real-time voice, video, messaging, and other interactive communic...

fair forge
#

perfect then

crystal current
# little breach i'd need to be basically using my internet to run the server right? which one wo...

Your computer would need to be turned on and connected to the Internet. A Minecraft server doesn't need a lot of power or bandwidth if it's not supporting a ton of users. Even a Pi can be enough. https://www.reddit.com/r/raspberry_pi/comments/vzj9ha/a_guide_for_minecraft_servers_on_a_pi/

Reddit

Explore this post and more from the raspberry_pi community

cedar forum
fair forge
#

i just need to have a server in the middle and let the client1 send a packet even if refused by client2 and wait for client2 to send a packet to client1 in order to enstablish a (connection), all that after receiving the infos from the server @cedar forum

little breach
#

i'll look into this and see the player limit

cedar forum
#

both clients need to send to the server for bidirectional comms, i can't remember the specifics of then convincing the UDP sockets to send to the peer address

fair forge
#

as i remember

#

like after having all the infos i need to send a packet that should not be received cause the ports are not open and the router don't know where to put this datas

#

and client2 after that should send client1 a packet that is interpreted as a response and redirected to the actual client

fair forge
#

so i'm learning about this UDP hole-punching and i'm stuck on a concept

#

if i use the server to get the infos of all the clients

#

so
Client1 1.2.3.4:5678 (address provided by nat)

#

Client2 2.3.6.9:5743 (address provided by nat)

#

so we talk to the server with those ports

#

when i try with C1 to send a packet to C2 does not the port change based on the new packet i'm sending? that is no more directed to the server?

pallid topaz
#

What are you trying to do?

fair forge
pallid topaz
#

For what purpose?

fair forge
#

videocall application

#

without opening ports and behind firewall

pallid topaz
#

Without prior port forwarding

fair forge
fair forge
#

but are a response from a request i made

pallid topaz
#

What?

fair forge
#

so basically

#

The thing to know about UDP hole-punching is that many consumer-grade Internet routers/NAT-firewalls have a policy along the lines of "block any incoming UDP packets, except for UDP packets coming from an IP address that the user's local computer has recently sent a UDP packet to"

#

the idea being that if the local user is sending packets to a particular IP address, then the packets coming back from that same IP address are probably legitimate/desirable.

#

then if i send a packet to C2 even if refused if C2 send a packet to me my NAT and Firewall let it pass cause it's flagged as legitimate

#

so i'm basically not listening to any router port

#

i'm making a request and waiting for a response

#

if i have to enable PortForwarding for responses you have to open a port even for requesting a website no?

#

and that's not this good i mean

small mural
polar sky
#

@hasty quest
how does this happen?

fair forge
#

can i udp holepunch with utp rendezvous server?

static geode
#

Hey guys does anyone know how to make my code work so i want to make it so like python files replace html files just strings code: ```python
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
app = FastAPI()

templates = Jinja2Templates(directory="templates")
@app.get("/")
async def root(request: Request):
return templates.TemplateResponse(
item=html, request=request
)

html = "<h1>Dash sucks this good</h1>"```

static geode
#

please

#

fine i will do it myself

placid birch
ember ledge
#

It looks like you want to dynamically render HTML content

#

So

#

render HTML content using FastAPI and Jinja2 templates. Your current approach is close, but it needs some adjustments to correctly pass and render the HTML string. Hereโ€™s how you can modify your code:
Use Jinja2 templates to render HTML.
Pass the HTML content to the template from your FastAPI endpoint.

languid jewel
#

@left berry how's your neural network going?

left berry
languid jewel
#

What are you planning on making the neural network do?

left berry
#

i thought i can have a llm or other things like neural networks that can each do a each indevejual things !
like one can be a philisophere
one can be like a lover
one can be like a thinker
like how humans brain works ๐Ÿ˜
idk
just thinking ways right now
what about your project ?!

ember ledge
#

um

#

Intenal

#

ip

#

adress

#

like

#

Internal IP addresses are used for communication within a private network, such as a home, office, or organizational network.

ember ledge
#

Internal

#

ip

#

addresses add a layer of security by isolating the internal

#

network from the external internet. Direct access to devices on the internal network is restricted, reducing exposure to external threats.

languid jewel
frigid vault
#

FastAPI vs Flask vs Django use cases, prons and cons.

stray harbor
#

Anyone who could help me with a simple Flask task? can't seem to get it to work

languid jewel
languid jewel
frigid vault
#

Is TCP/IP included in layer 7 ? Like if a program supports only layer 7 networking that means it can read all protocols, but if it supports only layer 4 that means it can only access TCP/IP and UDP/IP packets. Right?

proud swift
frigid vault
#

So even if it is above layer 4 it doesn't include layer 4?

cinder mural
#

Can someone help me speed up this network request?
On Chrome, I can see the full time of the request is 1.03 seconds.
In python using requests.session it takes 2.19 seconds

#

Saving a full second would be great, what am I doing wrong?

#

it's just a very simple POST

content=session.post(url=urlUpload, headers = headerUpload, data=dataUpload).content.decode('utf-8')
cinder mural
#

Doh I realized it's probably the decoding to utf-8

celest yoke
#

Hey y'all. My ISP uses CGNAT, and I'm trying to make a UDP listener in python. It works, but on LAN. What could I use to bypass the CGNAT, and open a port / a way to get the packets to my PC? Any FOSS options?

celest yoke
proud swift
#

They do cgnat and no v6? That's ludicrous

edgy pelican
#

if they were using v6 they could just give everyone their own ip

proud swift
#

Usually cgnat is for v4 and they provide v6 in dual stack

edgy pelican
#

huh

cedar forum
#

only time i've seen this kind of single-stack v4 with cgnat is like... dodgy cell carriers

celest yoke
edgy pelican
#

me with no cgnat :sip:

#

damnit i dont have nitro

left berry
cinder mural
#

So, I'm trying to convert from Python requests to pycurl. Is there an easy way to do this, or do I have to reformat all my data

cinder mural
#

wow while doing this I figured out the problem

#

I wasn't sending any headers

#

So I guess the server was sending me slow responses as a result (maybe some kind of compatability mode)

wind oriole
cinder mural
#

My original concern was that when I used a particular API from the browser, I was getting 1 second times, but from python was 2 seconds.

#

I think any additional benefit from a different library isn't going to be significant. Maybe a tenth of a second

#

not worth making my code brittle and have more dependencies

#

Probably can't meaningfully increase the speed beyond what the browser would do

nova ivy
#

whats the point of CNAME and MX type DNS records, why the don't map aliases straight to IPs?

edgy pelican
#

good questio

edgy pelican
#

these map domains to IPS

#

Alias of one name to another: the DNS lookup will continue by retrying the lookup with the new name.
CNAME is 1 domain -> another

#

A mail exchanger record (MX record) specifies the mail server responsible for accepting email messages on behalf of a domain name. It is a resource record in the Domain Name System (DNS). It is possible to configure several MX records, typically pointing to an array of mail servers for load balancing and redundancy.
and MX points a domain to another domain which is the mail server

cosmic sky
#

Hi! I have 2 processes and both of them have the same TCP socket. Is there a problem if from one process i read data from the socket while from the other process i send data through it?

open radish
#

Does anyone have experience with modbus

nova ivy
#

thanks @edgy pelican

nimble shadow
#

Hi @stray harbor I can help you. DM

obtuse tree
celest yoke
#

Apparently they brick their terminals with CGNAT unless u make an application, which is usually denied. BUT, they do usually disable the CGNAT when getting a DDNS from them.

humble fog
#

Hello fellow programmers! I am parsing a site, and everything's alright BUT some kind of dynamically loaded element ruins everything. I tried to use playwright lib to extract this thing, but for some reason it doesnt work. I have no idea what's the deal with this thing is. If anyone can help, i'll be awfully greatfull!
Code:

async def main():
    async with async_playwright() as p:
        browser = await p.chromium.launch(headless=True)
        page = await browser.new_page()
        await page.goto("https://bamper.by/zapchast_dvigatel/22348-114861368_1/", timeout=60000)
        await page.wait_for_selector(".js-breadcrumbs", state='visible')
        print(await page.content())
        await browser.close()


asyncio.get_event_loop().run_until_complete(main())

Markup of breadcrumbs is on picture.

ember ledge
#

This site looks weird

#

kind of russia

proud swift
humble fog
light pivot
#

how can i start

#

coading

steep ledge
azure kayak
#

Is there an alternative to setting a socket timeout so that I can shutdown a socket? I also know there is the possibility that you just create a dummy client socket that connects/disconnects from the server, but I'm hoping for something a bit more programatic...

woven ferry
#

hey guys Im learning python( is it a good idea for networking tho? When compared to something like go and cpp? ) but I wanted a project and I was thinking of something like Napster ? Is that a good go? Like any networking app like that
Also could i monetize something like that even if I do end up building it( I might be thinking a bit ahead of myself but still xd)
I mean, napster was a big thing when it came out right? Is there still a potential for something like that today?

azure kayak
#

Napster? Is that still around?

#

I don't want to dissuade you from learning Python, but I don't think any Napster-like service could ever gain traction today

woven ferry
azure kayak
#

ยฏ_(ใƒ„)_/ยฏ

#

it would be worthwhile to learn programming so that when you have an idea or a need for a tool, you can implement it

woven ferry
#

thanks anyways

azure kayak
#

well, just practically speaking, if you haven't learned any programming before, going from "nothing" to "napster" is not an easy task

#

the napster protocol is open (or at least there was OpenNap at one point), so you can see how it works

woven ferry
#

dont really know what to aim at, but then I thought of hitting the networking side man

safe shore
#

hi everyone can i chat with someone about practicing pythin

#

python

little breach
#

might seem like a dumb question but is there an app that fake simulates cisco connections so i can practice cisco commands without physical wiring or hardware

#

i assume its possible in theory but i don't know if its actually done

cedar forum
little breach
#

Does this allow me to simulate configuring ospf and ipv6 etc?

cedar forum
#

yes

#

you can spawn in hardware and run any configuration you want on it

little breach
#

Thank you I'll check it out

cedar forum
#

i don't have it installed right now so can only show you google screenshots, but regardless I think this will certainly get you somewhat along what you're looking to set up

little breach
#

Needed to practice for exams without going in person so this is crazy helpful

cedar forum
#

ahh if it's for exam-style things then yeah packet tracer should 100% cover you

#

looks like you might have to do some sort of enrollment now to get access to the downloads but you should be able to just put in phony info and get the install instructions

little breach
#

i kinda want to tinker around outside of uni anyways so wouldn't mind having it

quasi flower
#

Hello, I currently have a code that create a tcp connection with a server. However I need this connection to use a proxy. Is there an easy way to achieve this?

quasi flower
cunning cedar
#

i want to see if somoene has already created a sock5 proxy if yes i have some questions that i would like to ask or he can point me to a github repo that can help or something

calm fern
#

im trying to connect my google cloud function to cloud sql... i need it for my school project: a system that will send you emails in the morning even when your pc is off.. the problem is ive been stuck with the same errors for three days:

-pymysql/connections.py613

-socket = socket.create connection

-pymysql Operational error: cant connect to MySQL server on (localhost and mycloudsql public ipaddress)

pag nirurun ko yung code ko locally using the cloudsqlproxy.. gumagana naman sya. pag nilalagay ko sa cloud function.. hindii and its the same errors that keep showing to my log. guys im new to apis and cloud and im honestly lost. i already ran out of yt videos to watch and follow..

also tried using vpc connector but nung iseset kona sa cloud function yung vcp, error occurred: Insufficient CPU quota in region

these are also the code that ive tried using:

1.)

def get_conn():

return pymysql.connect(

host=instance's public ip address,

user=DB_USER,

password=DB_PASS,

database=DB_NAME

)

2.)

connection = pymysql.connect(

unix_socket=f'/cloudsql/{GOOGLE_CLOUD_SQL_INSTANCE_NAME}',

user=get_secret('DB_USER'),

password=get_secret('DB_PASS'),

db=get_secret('DB_NAME')

)

quasi flower
sullen ether
#

i got a list of the mac addresses and i'm wondering, what if pc-a wants to pass a frame to s1, the mac address of s1-vlan1 would be used in the frame right?

past nova
#

Why does it have a Mac?

sullen ether
past nova
sullen ether
past nova
#

Isn't it the same as the macs phisical interface?

umbral scarab
umbral scarab
# sullen ether

If by "pass a frame to s1" you mean directly talking to S1, for example accessing S1's management interface, PC-A would use the MAC ending on 4ca1 as destination. Which is assigned to the virtual interface that has 192.168.1.11 configured, the IP address you'd be connecting to.

I say that with 90 but not 100% certainty.

dusty lance
dusty lance
sullen ether
#

And yeah i configured them via console

dusty lance
#

Ahh...im here bcuz im learning data science

#

Nvr thot this server also have networking channel

#

Just now noticed

umbral scarab
dusty lance
#

Rather im explained my understanding regarding vlan and the reasoning im doing so is there anything that i may need to understand about vlan other than that?

#

Like to broaden my understanding regarding vlan

#

But im srry tho that it sound random

umbral scarab
# dusty lance Rather im explained my understanding regarding vlan and the reasoning im doing s...

You are correct that VLANs form a broadcast domain so an ethernet broadcast from one VLAN doesn't reach other VLANs. That's one benefit of using VLANs.
But that technically doesn't have anything to do with subnets, which are a network layer thing.
In practice they are usually used together so if it's that's what you meant, I misunderstood you. Sorry if that's the case.
But you don't need subnets to have VLANs and vice versa, there's not necessarily a 1:1 relationship between them.

zinc hound
#

hi @cosmic vigil !

right so, since you mentioned I should try experimenting; I immediately experimented with changing the port. So I changed it and tested "oha http://localhost:{PORT}" to send multiple concurrent connections/requests and it worked

but when I tried to change it to the original port number, now it's giving me an error that Idon't quite understand

I was learning more about the curl command, to test my code locally

#

hmm, let me change it once again

#

but now it worked

#

whatt

#

lol

#

changed it to 1142

#

why's that?

#

except for 4221, which is the original port, it works

cosmic vigil
zinc hound
#

oh..

#

I see

cosmic vigil
#

is it working now?

zinc hound
#

let me change it once again to 4221

#

lemme see

#

yep, not really

cosmic vigil
#

wait i think you made the curl request to 4221 when the server was running on 1142

#

check which localhost you're making the get request to

#

oh wait icccc

#

i didnt read the error

zinc hound
#

yeah.. lol

cosmic vigil
#

you can run a single socket on a single port

#

you are running main.py from the vscode terminal and the git bash terminal too

#

sooo just run it in either one or the other

zinc hound
#

yeahhhhh butt

#

first I run the file, right

#

then the cmd

#

but that error appears when I run the file

#

but I think we don't need to dwell too much on it

#

lol

#

since it works on the other port

cosmic vigil
#

whats happening is that you have 2 terminals trying to run 2 servers on 1 port

zinc hound
#

oh

cosmic vigil
#

when you make changes to the file it doesnt really trigger a re run of the server

zinc hound
#

ohh

cosmic vigil
#

so in one state if you set the port to 1000 and run the file, it runs on 1000 but as it is running and you change the port to 2000, the server will continue to run on 1000 and if you run the file again in another terminal, it'll run the same file on 1000 and 2000

#

like you gotta manually shutdown and restart the server

zinc hound
#

oh that makes sense

#

soo, how do I restart it then?

cosmic vigil
#

where you are running the server?

#

in vscode or gitbash?

zinc hound
#

uhh I don't quite understand

cosmic vigil
#

did you run python app.py in the bash terminal or inside vs code's integrated terminal?

zinc hound
#

oh in the integrated terminal

#

but it's bash

cosmic vigil
#

yea like open it

#

hit ctrl + c a few times

#

that'll bring the command line up

#

and then run python app.py again

zinc hound
#

then ctrl + c a few times

#

and just run the file again? alr

#

hmm

#

but I think we shouldn't dwell on it too much

#

since it works with a different port

cosmic vigil
#

alr great

edgy pelican
#

why do people use DoH over DoT?

final meteor
#

How come the first packet doesn't cause a SYN/ACK to be sent back but the second one does?
Are the extra options really necessary for it to work or what else could be wrong?

final meteor
umbral scarab
final meteor
umbral scarab
final meteor
#

ty though

umbral scarab
#

And I was wondering why I saw multiple seconds of delay between them ๐Ÿ˜…

final meteor
#

Yeah my bad

gentle blade
#

guys, i want to make a chat room app and host it through my computer, but i have a dynamic ip

#

and from what i remember when i was younger and tried to host a mc server it is a problem right?

crystal current
gentle blade
crystal current
gentle blade
crystal current
hasty quest
#

@gentle blade traceroute can help

#

maybe

#

It can be hard to interpret. But if there are two stages of NAT (1 being yours, the other being CGNAT) you might be able to see the CGNAT with it.

edgy orchid
#

anyone got a suggestion of a framework to use in python?

crystal current
ember ledge
thorny cove
#

is there an off topic channel?

dusty lance
#

so uhh..transport input ssh?

edgy pelican
#

lmao

crystal current
errant bayBOT
edgy pelican
#

i had an internet issue

#

whoever guesses what it is first gets a cookie

final meteor
#

Im sending the first tcp SYN packet from my own program ive written to port 8000 where a http server is listening. As you can see it doesn't trigger a response to be sent back. The second packet is sent when I do curl localhost:8000 and that does trigger a response even though the packets are practically identical, except for some extra options in the second packet which I don't think is making a difference.

What could be the reason for this behavior and how do I solve it?
this is on linux btw

edgy pelican
#

me when i read this channel: ack /pun

stuck zodiac
#

I have discussed it with my friends as well as researched the internet, but I couldn't find a proper way to find if an ip address is using vpn and proxy or not without using APIs and check the fraud score of that particular IP address ๐Ÿ˜”๐Ÿ˜”
Can y'all help me or provide me some link to it

cedar forum
#

you can check who "owns" the IP that the request is coming from and try detect things based off that

#

based on that you can try narrow down known VPN companies, you can easily narrow down IP ranges like "Microsoft Azure" or other cloud providers

#

you can also do heuristics like checking for open ports on the IPs on known VPN connection ports and seeing if you get a connection, but that's very time intensive to do on a request

#

most of these services are basically probing the entire internet and checking for open ports on every host, so they don't need to check it on request, and that's why these ip rep/fraud score services exist and work so well, because they are just constantly scanning the internet for this data instead of compiling it on your request

#

unfortunately it's not something that will ever be able to be completely automated, you can just try your best to catch 90% of VPN users that come through common providers, and will have to do other forms of periodic aggregation of your requests to catch the others

#

filtering hosting companies and known VPN companies will cover you for the majority of cases, if a request comes from Azure, GCP, AWS, DO, etc. then you know it's a proxy and that will cover a large portion of proxy users

stuck zodiac
cedar forum
# stuck zodiac how did you do this?

WHOIS (pronounced as the phrase "who is") is a query and response protocol that is used for querying databases that store an Internet resource's registered users or assignees. These resources include domain names, IP address blocks and autonomous systems, but it is also used for a wider range of other information. The protocol stores and deliver...

cedar forum
#

you can lookup domains, IPs and ASNs through whois

stuck zodiac
stuck zodiac
cedar forum
#

if you are running an API, then requests from cloud providers are obviously just applications most likely

#

if you have requests going to endpoints for humans from cloud providers, then you are either being a) scraped or b) receiving a visitor through a proxy

#

you can sometimes delineate between a or b by looking at the user agent (i.e. is the user agent a browser, or something like Python-requests/0.3.1 or whatever), but obviously that can be very very easily forged and should never be trusted

stuck zodiac
#

need to research hard

cedar forum
stuck zodiac
#

nothing is going in my mind lol

#

somethings only

#

haha

cedar forum
#

there is a lot to it, there's a reason people make full businesses out of this hahahahahaha

stuck zodiac
#

is this a business thingy?

cedar forum
# stuck zodiac wait how?

all those companies that run fraud checkers / ip rep checkers / proxy detectors are profiting off knowing if requests are legitimate

#

they just compile a big database of all IP addresses and run a set of checks on there to determine their confidence of different things

stuck zodiac
stuck zodiac
# cedar forum yep exactly

basically, I'm doing an intern in a startup and the owner is developing a code to check all stuffs of IPs for his start-up and he told me to help him in it.
he's working on reverse dns and other things and told me to look on detecting vpns and proxys of a requested ip lol

stuck zodiac
cedar forum
# stuck zodiac basically, I'm doing an intern in a startup and the owner is developing a code t...

ye then it's the stuff mentioned above you'll need, but unfortunately it is mostly based on maintaining some sort of tracking on which ISPs are confirmed hosting companies and which are not, and those proxy detection businesses have been doing it for years to build the knowledgesets they have now, there is no easy classification of "this ASN is a hosting company" vs "this ASN is a residential IP"

cedar forum
#

it's a sort of safety net in that if your network is being attacked from an IP in a range you can lookup the data with whois and find a contact email for their network operations center

#

IPs are allocated by regional internet registries (RIR), so I get mine from RIPE because I'm in Europe. with that, i have to submit that information to RIPE for them to expose via their whois servers

#

but yes you will find info on every range via whois

#

but again, it's an expensive operation, so doing all these operations on every request is not efficient and not worth it, you need to just track IPs and run this sort of detection on a background basis

#

if you need immediate access on every request, you're going to need one of those third party APIs

stuck zodiac
#

I c thanks so much

#

Gotta research whatever you're speaking

cunning cedar
#

guys does anyone have ressources to build a http proxy server from scratch functionalities are site blocklisting/authenitfication/loging ( i think all of this are easy after i can impolement the logic of the proxy server) i searched everywhere and it seems to be none

cunning cedar
#

update from the ressources i found + some chatgpt help here is the version i have now

#

current problemes i can t work with https websites even if i tried to create my self signed cert with openssl and made some midications to code (this the main probleme) i would like to add some authentification but i don t know exactly how + some http websites (just one till now don t load fully) any help or recommandations is aprecated

cedar forum
#

this is an incredibly manual way of writing a proxy

#

i'd use something like https://pypi.org/project/proxy.py/ and write plugins for the specific things you need

woven ferry
#

yo guys could you recommend some great networking projects to learn it? something perhaps ambitious lol

cedar forum
# woven ferry yo guys could you recommend some great networking projects to learn it? somethin...

check out https://github.com/karan/Projects#networking, few low hanging fruit projects to get familiar with some networking concepts. otherwise, just familiarise yourself with each level of the networking stack (OSI or DoD is fine) and know what the purpose of each layer is, which bits of hardware look at it, etc.

GitHub

:page_with_curl: A list of practical projects that anyone can solve in any programming language. - karan/Projects

#

learn the socket module in python, learn how to build TCP/UDP client/servers, learn how to add encryption to those with things like the ssl module

#

etc. etc.

edgy pelican
cedar forum
#

lol no idea

sullen ether
#

so i ran a speed test 5 times provided from google and it's weird my download speed dramatically changes in just a short time?

crystal current
cedar forum
#

yeah this is probably traffic shaping done wrong

#

might also be a good idea to try a continuous speed test with iperf between two servers

ember ledge
#

my damn

#

I just got 50

hazy root
#

long story short, if I call api from curl, it sends the requests, no packets for 210ish seconds, starts recieving data

if I query with python, it sends the request and leaves the tcp connection in established state forever with no more packets

edgy pelican
#

well that doesnt sound okay

hazy root
#

after adding keepalive options to pycurl it magically works, except I see no keepalive packets going on

#

here be demons, I tell you

hazy root
#

*keepalive packets are there, tcpview windows side didn't see them, but I can see them on the router

#

still doesn't explain why plain binary curl handles the download with no issues

cedar forum
#

huh

edgy pelican
#

sounds like bad programming

edgy pelican
#

on the server