#networks

1 messages · Page 12 of 1

proud swift
#

What's the API?

surreal pumice
proud swift
#

You can't send multipart (form with file) and application/json at the same time

#

Show the source to the Django rest framework view?

surreal pumice
#

serializer:

class PostSerializer(TaggitSerializer, ModelSerializer):
    tags = TagListSerializerField()

    class Meta:
        model = Post
        fields = ("title", "body", "image", "alt", "tags", "pin", "status")

view:

class PostViewSet(ModelViewSet):
    permission_classes = (IsAuthenticatedOrReadOnly,)
    queryset = Post.published.all()
    serializer_class = PostSerializer
proud swift
#

And how are you processing the file?

surreal pumice
#

i have a cli client like this:

async def post(title, body, image, alt, status, tags: str, pin):
    token = "some token"
    files = {
        "image": open(image_file, "rb"),
    }

    data = {
            "title": title,
            "body": body.replace("\n", ""),
            "alt": alt,
            "status": status,
            "tags": tag_list,
            "pin": pin == "y"
            }

    data_en = json.dumps(data)
    headers = {"Authorization": f"Bearer {token}", "Content-Type": "application/json"}

    async with httpx.AsyncClient(http2=True) as client:
        response = await client.post(url="localhost:8000/api/", data=data, headers=headers, files=files)
proud swift
surreal pumice
#

did that 🙏

dusty lance
#

hey, sir can i ask you?
i alr understood, routing protocols like RIP,EIGRP&OSPF benefits from multicast, so whoever subscribe to x muticast can receive and listen to the packet
but, i dont understand things like PIM,IGMP like arent they alr subscribe to listen their particular subscribed multicast in these routing protocol(RIP,EIGRP&OSPF), and they alr have their own algo model to find the best path, so whats the point of PIM or IGMP?

rose vessel
#

Basically PIM and IGMP are used to manage multicast traffic.

PIM isn't really tied to a specific unicast routing protocol (thus the name protocol independent multicast) which gives it flexibility.

IGMP on the other hand is more of a local network to manage local memberships and optimize traffic flows

torpid sparrow
surreal pumice
ember talon
#

How to solve

#

I am on lightning ai

rose vessel
#

Could be your router is blocking the UDP port, you may have to look at its settings

raven owl
#

Guys , anyone have any idea how can I get the raw response header in text string format (either in ascii or utf) from an api request?

proud swift
jolly python
#

Any idea where I can find some docs/examples for an auto-finder system using <broadcast> in socket to make the connection between two devices in the same network (with the ability to choose which device to connect to) and when the device is selected, create a P2P connection between these two? (Using sockts)

#

owo?

tardy idol
#

anyone here familiar with tailscale? Just dowloaded it on win 11 and it does the blue circle thingy for like half a second then nothing. please help.

crystal current
velvet brook
#

I'm building a Python code optimization tool called codeflash.ai and I've managed to speed up an important section of the python requests library. I'm thinking of getting this merged upstream. Do you know what would be the right way contributing to python itself? Should I talk to any particular python developer about the optimization I have?

sharp sapphire
#

I am working on a progresstracker (iterables, functions and logs) called ProgressPal (https://github.com/levi2234/Progresspal). It works great and as intended. It works by making a post request to a flask server which then handles the visualization and data processing. This works great when the site is hosted locally and the requests are sent to localhost. However when I publicly host this site through built in vscode port forwarding, sending requests to that webadress do not seem to get through to the flask webapp. I have a feeling this has something to do with the https protocol but I'm not sure. Also check ProgressPal out! It is a different take on progress trackers such as tqdm and rich and is very extensive.

prisma cobalt
#

additionally, have you tried port forwarding without using vscode?

daring tendon
#

is there any dtls library for python 3.7

worthy saddle
#

Hey everyone!
I’m Greedo, and I run DM Techs, a digital agency specializing in:
🌐 Website Development
📱 Mobile App Creation
📈 Digital Marketing & SEO
📍 Google My Business Services

If you’re looking to grow your online presence or need tech solutions, feel free to reach out. Always happy to connect and collaborate! 😊

trim ether
#
import asyncio
from mee6_py_api import API

SERVER_ID = 1201216512212615198
USER_ID = 995049309902999714

mee6API = API(SERVER_ID)


async def fetch_leaderboard():
    print(await mee6API.levels.get_user_level(USER_ID))


asyncio.run(fetch_leaderboard())```This is throwing me this error:```server could not verify that you are authorized to access the URL requested. You either supplied the wrong credentials (e.g. a bad password), or your browser doesn't understand how to supply the credentials required.```What credentials am I supposed to be supplying? And how?
thorny solstice
#

i thought mee6 was its own bot?

#

they have an api?

worthy saddle
azure pendant
#

Trying to code a RAT that allows me to control another computer on the same private wifi but the tcp is not connecting

I was following the winsock docs in C to make the tcp connection using my host server and the guest vm as the client but it didnt work. then I tried using another laptop on my same private wifi as the client but it still wouldnt connect to my server socket.

The code works and the sockets connect when I run the server and client on the same pc using localhost so the code is not the problem it seems to be network settings specifically the router maybe.

Im pretty sure I had the setup right, I was listening on the port, turned off firewall. entered in the wifi IP adress of the server into my client socket so it knows where to connect but nothing worked. is there anything else to try? or its probably just a setting on my router. i dont own the router so i cant change or view the settings.

Is there anything I can do to make my RAT? I just want to be able to control another computer or VM in my house for learning experience.

visual tangle
#

if it’s not your code then I’m sure the issue is simply just port forwarding

azure pendant
visual tangle
#

I made a rat and did the same thing but I was successful I was able to control and turn on my other pc webcam

azure pendant
#

I can’t change it tho since it’s my mommy’s I can’t change the settings

azure pendant
visual tangle
#

I used a cnc server

#

But honestly you can rat in a few ways sooo

edgy pelican
#

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

ember ledge
#

can someone help me

#

my python file is not opening

azure pendant
thorny solstice
devout crater
terse perch
#

Hey Guys 👋
anyone here who have completed Computer Networking A Top Down Approach by Jim Kurose

#

Or any other networking book

rose vessel
#

<@&831776746206265384>

lofty bough
#

!cban @worthy saddle spam

errant bayBOT
#

:incoming_envelope: :ok_hand: applied ban to @worthy saddle permanently.

last quail
#

Portaligner is a Node.js package designed to linearize requests from multiple ports onto a single port. This is particularly useful for applications that are limited to accepting connections from only one open port, such as those hosted on platforms like Render.https://github.com/SanshruthR/PortAligner

GitHub

Linearize requests from multiple ports onto a single port. Currently monitoring: https://dockerhost.onrender.com/5000 - SanshruthR/PortAligner

edgy pelican
errant bayBOT
#

:incoming_envelope: :ok_hand: applied timeout to @tranquil prairie until <t:1734705723:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

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

delicate turtle
#
import time
import socket

with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp_socket:
    udp_socket.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
    udp_socket.bind(('0.0.0.0', 0))
    while True:
        udp_socket.sendto("test broadcast".encode(), ('255.255.255.255', 4446))
        print("broadcast sent")
        print(f"Socket bound to: {udp_socket.getsockname()}")
        time.sleep(2)```

I have an issue where I can run this code on a different laptop on my network and have it show up in Wireshark on my laptop, but not vice versa. 

On my laptop, I can run this only by replacing "255.255.255.255" with that other laptop's IP address and have it show up on Wireshark on both devices. Otherwise, it'll show up as sent on my device's Wireshark but not show up as received on the other device.
#

There's a chance that hosting Minecraft LAN worlds are also not working on this laptop but I haven't tested it yet, which may be a related issue.

delicate turtle
#

Oh what the fuck all UDP messages are being sent from vEthernet instead of wifi on my laptop.

#

Of course I'll need to figure out how to get it to go through the correct adapter.

delicate turtle
#

Resolved, had to go into device manager, disable the ethernet adapter, then restart.

gilded seal
#

Hi someane have a list for network projects in python?, I saw a lot of theory of networks but I want more aplication in programming.

rose vessel
gilded seal
rose vessel
gilded seal
#

OHH I'm gonna watch

sweet breach
velvet brook
# sweet breach requests library is open source in github, fork, do changes, PR

yep, already have it open. looks like it will be hard to get attention from the maintainers to get it merged https://github.com/psf/requests/pull/6853

GitHub

Reason for Raising the PR
The changes aim to optimize the given requests library code for better performance and most widely used function status_Code, we think we can make a few improvements. This...

lapis canyon
#

Hi everyone, I have a problem which I've been stuck on for a while.

I want to make a client-server TCP app, however I want to be able to constantly accept connections whilst also being able to message all clients at once through the server app. Which ever route I go down I always end up with multiple while loops. I have looked into threading and attempted to put the client, address = socket.accept into its own thread and broadcast operations on another however this still does not work. Any advice?

gloomy root
#

Also worth noting that imports are cached, you can do:

#
for _ in range(20):
  import bar

And the global code will only be ran once under normal conditions

midnight flicker
# lapis canyon Hi everyone, I have a problem which I've been stuck on for a while. I want to m...

I have only read the code

I think the for loop on line 29 is the issue
The range function generally skips the last value you give it so range(0, 10) will return 0, 1, 2, …, 7, 8, 9 but NOT 10

What could be happening here is the last element of the list gets skipped because you added -1 to the len in the range

So if you had one client connected len - 1 would be 0 so the for loop wouldnt run
If you had two only the first client would receive the message

#

This is just an addon, you can directly iterate over lists in python without range, so you could do:

for client in client_sockets:
client.send(message.encode())

Client would be an instance of each client socket in the list

Sorry for the bad formatting, i am away from my desktop

lapis canyon
#

This helped thank you: I also realised that my threads stopped when the main thread stopped too. So I just added another while loop to the main thread to keep it running. Probably not the best practice but oh well

midnight flicker
#

Glad to have helped, ah, maybe you could run Server Console Control in the main thread then?

rare sand
errant bayBOT
#

6. Do not post unapproved advertising.

coarse pumice
#

how to intercept packests in python?

pale lantern
#

Yo wassup anyone here

#

It's too cold in here

charred geyser
errant bayBOT
#
`if __name__ == '__main__'`

This is a statement that is only true if the module (your source code) it appears in is being run directly, as opposed to being imported into another module. When you run your module, the __name__ special variable is automatically set to the string '__main__'. Conversely, when you import that same module into a different one, and run that, __name__ is instead set to the filename of your module minus the .py extension.

Example

# foo.py

print('spam')

if __name__ == '__main__':
    print('eggs')

If you run the above module foo.py directly, both 'spam'and 'eggs' will be printed. Now consider this next example:

# bar.py

import foo

If you run this module named bar.py, it will execute the code in foo.py. First it will print 'spam', and then the if statement will fail, because __name__ will now be the string 'foo'.

Why would I do this?

  • Your module is a library, but also has a special case where it can be run directly
  • Your module is a library and you want to safeguard it against people running it directly (like what pip does)
  • Your module is the main program, but has unit tests and the testing framework works by importing your module, and you want to avoid having your main code run during the test
solid slate
#

Hello

charred geyser
#

is anyone here good with p2p Networks and could help by explaining me how I should organise one so its not hard to bootstrap and maintain whilst keeping it intact and hard to overthrow

long gazelle
#

Good day everyone!!!
Please is anyone familiar with python Twisted Library??

Which server company can I use to host it lively

proud swift
long gazelle
proud swift
#

trio supports datagrams

#

Even has dtls support

long gazelle
long gazelle
long gazelle
proud swift
#

?

#

It's the same as any other python app

#

Twisted is a bit tricky in that a failure can cause it to stop listening, but the event loop will keep ticking over

hallow python
#

can anyone help ive been having this issue, whenever i try to send a command from a desktop to b desktop, it needs to be encrypted, but if its encrypted it can't be executed as a windows command

storm onyx
#

decrypt it?

hallow python
errant bayBOT
#

:incoming_envelope: :ok_hand: applied timeout to @robust aspen until <t:1735896155:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

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

regal igloo
#

Do you guys have any clue on how to get 1080p feed at 30 fps from rtsp feeds? im using mediamts and later viewing it from mpv

errant bayBOT
#

:incoming_envelope: :ok_hand: applied timeout to @mighty steppe until <t:1736437349:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

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

brave river
#

Hey, do you guys have any good resources for neural networks? I have done things with CV2 before, but havent really touched NEAT or PPO. Any resourses that would for example, beat a game of snake, or play a game of minecraft, or something basic like 2048. Anything is good really.

fleet spire
brave river
fleet spire
fleet spire
orchid crag
#

Implement tracerouting and test your implementation with YAHOO.com. To use
Select UDP as the transport layer protocol and choose any port. How many hops
are along the path and what are their IP addresses.
(b) Vary the transport layer protocol and port. Are your results different?
Why not)?
(c) TTL/Hop Limit is usually increased by one with each packet. What could be the point?
to choose the order arbitrarily? What disadvantage does this result in?

Bro

#

its to be done for scapy

#
from scapy.all import *

def udp_traceroute(target, max_hops=30, port=33434, timeout=2):
    """
    Führt ein Traceroute zu einem Ziel durch, nutzt UDP als Transport-Layer-Protokoll.
    
    :param target: Ziel-Domain oder Ziel-IP (z. B. yahoo.com)
    :param max_hops: Maximale Anzahl an Hops
    :param port: Zielport für UDP-Pakete
    :param timeout: Timeout für Antworten in Sekunden
    """
    print(f"Traceroute zu {target} mit UDP:")
    destination_ip = socket.gethostbyname(target)  # Ziel-Domain auflösen
    hops = []

    for ttl in range(1, max_hops + 1):
        # UDP-Paket mit spezifischem TTL-Wert erstellen
        packet = IP(dst=destination_ip, ttl=ttl) / UDP(dport=port)
        
        # Senden und auf Antwort warten
        response = sr1(packet, timeout=timeout, verbose=0)
        
        if response is None:
            print(f"{ttl}: * (keine Antwort)")
        elif response.haslayer(ICMP) and response[ICMP].type == 3:  # Ziel erreicht
            print(f"{ttl}: {response[IP].src} (Ziel erreicht)")
            hops.append(response[IP].src)
            break
        elif response.haslayer(IP):  # Hop gefunden
            print(f"{ttl}: {response[IP].src}")
            hops.append(response[IP].src)
        else:
            print(f"{ttl}: * (unbekannte Antwort)")

    print(f"Anzahl der Hops: {len(hops)}")
    print("Traceroute abgeschlossen.")

# Traceroute zu yahoo.com durchführen
udp_traceroute("yahoo.com")

doesn't work

tawny pecan
#

Does anyone here use netmiko?

worn junco
#

hello guys i need to do a large upload on sheets and the upload data to sheets is not working that well do you have any tip on how to fix it is showing the 503 api error
APIError: APIError: [503]: The service is currently unavailable.

hearty field
worn junco
#

Yes, i guess is something related to the amout of tuples sent to the databank

north schooner
#

hey guys

delicate cave
#

hey, I’m looking for developers who’ve won competitive programming or hackathon events and also python engineers we have a great project

tiny vault
#

what is the name of ur project

prisma cobalt
upbeat cosmos
#

Last week something happened to my wifi
It operates normal when using yt and Google but gives no internet in other platforms (even in discord)
How?

willow flare
#

Also, how do you know it's the wifi but not a specific device? Did you try on multiple devices?

upbeat cosmos
willow flare
#

On which device does it not work?

upbeat cosmos
willow flare
#

Okay so, it is safe to conclude that your WiFi is not at fault, right?

upbeat cosmos
#

Yeah

#

So something is wrong with my phone 🤧

willow flare
#

From what I can see, it might be that you tried adding some proxy to your phone but didn't remove it.

#

Do you know what a proxy is?

upbeat cosmos
willow flare
#

Yeah.

upbeat cosmos
#

Oh yeah
I remember switching to Singapore VPN b4 this incident

#

So ig i didn't disconnect it properly

willow flare
#

If the vpn is not active now, then that should not be the problem.

upbeat cosmos
#

Apparently it stops working from morning till 3pm and then my wifi works normally on all platforms

willow flare
#

iNtErEsTiNg.

upbeat cosmos
#

My phone acts weird in many ways
Like even after stopping tha alarm the sound goes off but the vibration stays unless i unlock my phone

willow flare
#

Those shouldn't be a problem. Where are you from BTW?

upbeat cosmos
#

India

willow flare
#

And go to your WiFi settings (on phone) and check proxy

#

@upbeat cosmos lmk if this is none or not.

#

And deactivate any VPN for now.

upbeat cosmos
willow flare
willow flare
#

PS. There was no proxy and I couldn't figure out the issue. Someone else take over :p

cloud spruce
surreal pumice
#

hi
is there a way to set DNS when using httpx or request?
i want to test if a dns can resolve the URL

#

i've tried dnspython, but as far as i can tell the package has no way of accessing the status code, which i need to check for 403

coarse summit
#

cant you pre fetch the IP based on your domain, and then request that API?

#

hopefuly it will let you access whatever you're trying to access

frozen drum
dim kite
#

any idea why on my debian vps print(socket.getaddrinfo("abcde", 12345)) returns the IP adress of the server instead of "getaddrinfo failed"? when the host exists it gives the correct ip adress

quartz frigate
#

Our corp DNS has an A record for localhost=127.0.0.1
Is there any way that could possibly be useful?
I'm practically sure it's just junk.

lyric oak
ashen nova
#
IETF Datatracker

This document describes what it means to say that a Domain Name (DNS name) is reserved for special use, when reserving such a name is appropriate, and the procedure for doing so. It establishes an IANA registry for such domain names, and seeds it with entries for some of the already established special domain names.

#

seems quite reasonable to me

edgy pelican
#

oes noes my dns knows that im visiting localhost /j

coarse summit
#

oes noes

orchid flume
#

oes noes

reef talon
#

anyone know how to specifically extract gps data from pcapng files with scapy? i see its saved as a data block randomly within the pcapng file but it doesnt seem like theres any structure to when they're inserted lmao

reef talon
#

nevermind i created my own solution

quasi hill
#

💡 Recentemente, dei o primeiro passo na minha jornada na programação e comecei meus estudos em Python! 🐍
Depois de muito refletir sobre meu futuro, decidi entrar no mundo da tecnologia e escolhi Análise e Desenvolvimento de Sistemas como minha área de atuação. Minha faculdade na FIAP começa no dia 24, mas já estou me antecipando e estudando para...

frank scarab
#

Is there a way to create a ngrok http tunnel with the free static domain using pyngrok? Or will I have to resort to using the cli?

storm onyx
#

welp that got closed

#

but i found this

#

so i may just use net-snmp directly, i didn't know it had python bindings

#

native ones

#

linkrot docs tho...

storm onyx
#

it doesn't get mad when i give it bs protocol names, and this suggsts it only supports des?

safe loom
#

not sure if this is the right place for this.... but any suggestions for what type of server to look for to build your own vpn (probably do some other small projects with it too), not sure sure what to look for and heard a lot of the web servers like amazon are super sussy 😄

storm onyx
#

you can run a wireguard vpn on a potato

rain flume
#

woah

proper crow
#

made a geo-traceroute

#

you can check every hop in the map (every router in the the map)

warped rock
#

I want a job!

sweet breach
vagrant ermine
#

Im

reef talon
#

anyone here familiar with scapy and pcapng files? i'm struggling to extract custom blocks and doing something wrong here

elfin reef
#

Uhm

ember ledge
#

yooo

lofty wing
#

yooooooooooooooo

gentle elm
#

@bleak badge hey bro

bleak badge
burnt lake
#

hey guys so I was given this task at work to login to ciena devices (200 devices), check if port 9 is up, if it's up, clear the alarm in the NMS

#

not sure how to go about making python login to the devices using ZOC terminal and click the right buttons in the GUI to login, just like I do manually

#

does anyone know or have a link to where I could learn more ?

fringe parcel
#

Hi, I have a question. Is there a channel where you can look for assignments or something like that? Because I'm a python programmer with a porfolio, but I don't know if it can be done here.

cloud spruce
cloud spruce
cloud spruce
burnt lake
#

I have to check 500 ciena switches if port 9 is down

wanton nymph
burnt lake
#

So I have to write the script otherwise I’ll finish the task by next year…

#

It’s for work

cloud spruce
burnt lake
#

Not cool

#

200 or 500 or 1000 dosent matrrr

cloud spruce
#

but yeah, i see what you mean

#

so, does it really need to be through the ZOC terminal software or will any ssh client do?

#

@burnt lake question above 👆

burnt lake
#

Tbh I probably try a ssh client first then see what I run into

cloud spruce
cloud spruce
burnt lake
#

Ima try that

#

If that dosnet work then ZOC it is

cloud spruce
# burnt lake Ima try that

if you end up in a situation where you have to use the ZOC terminal client and want to automate it, you might want to try doing that with PyAutoGUI

cloud spruce
errant bayBOT
#

9. Do not offer or ask for paid work of any kind.

white lantern
#

<@&831776746206265384>

round glen
#

!cban 948232517335523430 nsfw

errant bayBOT
#

failmail :ok_hand: applied ban to @rough turtle permanently.

red fossil
#

hey, I found this on my google drive, donnoh if it'll help anyone here out 🙂

ember ledge
#

I was wondering if it would be possible to implement a small proof of work check in the users browser on the first load, then remember them for an hour, essentially sending them a nonce or some random seed and asking them to send the hashed result as a means of ddos protection

#

Is this possible in flask using the actual headers?

strong idol
#

can anyone guide me with computer networking subject

#

I only have the syllabus. If anyone can help, please DM me. That would be a big help.

prisma cobalt
ember ledge
prisma cobalt
#

that would certainly be possible with js

#

create a script tag that uses fetch (or similiar) to send a request once the page loads

#

but how are you solving ddos protection with that? the user still requests the page, unless you mean for that to be an intermediary page?

cloud spruce
# ember ledge Ideally, id load the nonce/seed into a html/js template using jinja, and once th...

this ha been done quite a few years ago (june 2019) already at fastly, maybe you want to look in to their solution: https://www.fastly.com/blog/defend-against-credential-stuffing-attacks-proof-of-work

With attackers using publicly available lists of compromised passwords in an attempt to steal accounts, proof of work is a good way to slow the attackers down.

#

but i can see an attacker using this to just send crap towards the server that doesn't need to check out

burnt lake
#

i'm having issues with connecting to jumpserver with paramiko

cloud spruce
ember ledge
#

It'll be proxied by nginx, then proxy my application server

cloud spruce
ember ledge
#

I'm writing it as a proof of concept to help myself understand more

#

I just wrote a fake crypto to learn Go, now I want to write this to better learn Python

cloud spruce
#

a DDoS protection system needs performance
no matter how much i like the language it's something python doesn't excel at

ember ledge
#

I think it would be ample to write in Python for now given it's a proof of concept, and I can always re-write it in Go layer

#

later*

cloud spruce
#

and for the server side in python you probably want hashlib to check the PoW

#

what are you basing your server on, fastapi maybe?

ember ledge
#

I'm using Flask currently

#

Would it be possible to achieve the browser side checks without JS at all, or is that just impossible?

cloud spruce
#

flask is definitely good enough to begin with

ember ledge
#

I'm not super familiar with Python, I usually use Go/Mux routers

cloud spruce
#

i think that is impossible, you need the browser to do work and i don't think html and css has enough features to solve this

ember ledge
#

I thought so, just checking

cloud spruce
#

the server side part that verifies the PoW should be trivial
but you might need more code to fight abuse where someone is attacking the PoW checker itself

ember ledge
#

So the reason I'm making this at all is to use it in situations where traditional ddos protection isn't sufficient, if they fail the checksum or don't complete it in x amount of time I'm going to block their connection for 5 minutes

#

And there will be a connection queue to prevent delays that are too large

ember ledge
cloud spruce
#

yeah, some kind of rate limiting or temporary blocking per ip is probably needed for too many failed PoW from an ip for this to be effective

ember ledge
#

I plan on using it for i2p sites

#

So I need to get creative with blacklisting

cloud spruce
#

ah, yes, that will be a challenge then

ember ledge
#

With Go, I could always just create concurrent threads for each request

#

And queue all failures, lowering their priority until they hit 0 from 5 being high priority

#

And if their priority is 0, make them wait after everyone else trying to login

cloud spruce
#

but how do you know it's the same client for different connections when you are hosing over i2p?
i can only see that work for multiple requests on the same connection

ember ledge
#

Session data possibly

#

Or even cookies

cloud spruce
#

for DDoS or even DoS cookies will be pretty ineffective as a means of identification if you need to identify a client to block them
rather a lack of cookie or cookie that doesn't validate correctly (if in a session table or signed like a jwt) or being used by too many clients at the same time would be able to trigger the need for new PoW
but i still don't see it as something to base blocking on over an anonymized network like i2p

ember ledge
#

Yeah it's an issue

#

On Tor I could just temp block the node

#

But i2p maybe it's not possible

cloud spruce
#

but temp blocking a whole node is quite brutal as there might be quite a lot of collateral damage if the site is popular

cloud spruce
# ember ledge What would you do?

it's a challenge, i don't see a very viable option to temp block a client other then to drop their connection, but then they can just connect again
defending against DDoS on anonymized networks is a challenge and it doesn't have really have a good solution as far as i know

ember ledge
#

I know private mirrors help too

#

But that's not viable in every situation

cloud spruce
#

distributed sites on anonymous networks is another story but things that is akin to hidden services is problematic to defend

ember ledge
#

What do you think about having a priority system, as well as dropping them?

cloud spruce
ember ledge
#

Yeah for sure

#

I figure at least that way genuine users will have more success

cloud spruce
#

depending on what you use your site for things like just publishing the content to the network might be an option
then you are not really hosting it yourself, it gets cached in the network and spread around by people accessing the content

#

but then there is no python component to it anymore and OT for this channel

ember ledge
#

How does caching work on those networks?

#

I've only ever heard of a web server being run behind a Tor or i2p proxy

cloud spruce
#

content is published using the private key in a asymmetric key pair and the content can be accessed through the public key as an address
only someone with the private key can publish to that address and sign the content so that every node that reads and cache it knows that the content hasn't been tampered with

#

anyways, i think this conversation is going too far off-topic for this channel now to be continued here unless you have anymore questions centered around python

cloud spruce
ember ledge
#

I feel like if I did use Python for the final version, I would just write the PoW code in C and call it from python

#

And just use Python + Flask for the app itself

#

I'll have a look into Quart though

#

Most of the pages are html/css only, heaviest thing I'm rendering is just images

cloud spruce
#

and if you need to do a lot of io you can pair it with httpx which is very close to requests but async and aiofile (real asyncio) or maybe anyio (using worker threads and thus not as performant) for async file io

burnt lake
#

and it uses socks5, idk if that matters

cloud spruce
# burnt lake and it uses socks5, idk if that matters

it does, paramiko doesn't have any native support for socks5 as far as i know
but it can easily be combined with for example the python_socks module (pip install python-socks) to create the socks5 socket
and then use it with paramiko as the socket (using the sock parameter) that paramiko uses to runs on-top of

sleek delta
#

How can i build a wsgi server from scratch?

#

Not much documentation on how to accomplish this

rustic hatch
#

Hello guys! Do you know if I have a startup and access to investors? Where can I find a Python developer who has worked with neural networks?

#

Is there such a developer here?

sweet breach
#

!rule paid also this

errant bayBOT
#

9. Do not offer or ask for paid work of any kind.

pure owl
#

Hello guys iam new here do you have any experiences about network

#

And network security

cloud spruce
pure owl
cloud spruce
pure owl
#

Where can I learn such things

prisma cobalt
#

you could do it with the threading and socket module. asyncio if you're feeling lazy, select if not

#

let me know if you need any help, I've done a similar project in the past

sleek delta
#

i have been working on it for a while but I am beyond confused as to what the dictionary needs to contain. also i just dont understand what i have to send and receive from the flask application.

#

i am using socket

prisma cobalt
#

could you share your code

#

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

sleek delta
prisma cobalt
#

just an honourable mention but have you checked out asgi yet? its the newer (better) alternative to wsgi

sleek delta
rapid sky
#

Ive tried researching but cant find anything, so i assume the answer is no, but: does the socket module automatically do error checking/prevention of packet loss?

prisma cobalt
rapid sky
prisma cobalt
#

Yeah built in!

prisma cobalt
# rapid sky You mean built in, or you have to do it yourself?

TCP (transmission control protocol) provides “reliable, ordered, and error-checked delivery”. It does this by adding a small header to the top of each message you send that contains information like order as well as a bit of data for error checking. The receiver can check the order of each message and re request any that it’s missed making the protocol reliable and ordered

hazy iron
hazy iron
prisma cobalt
#

not sure on that one, you'd have to do a little research there

rapid sky
#

So can can just do

    s.send(p)```
?
#

Without any extra stuff?

hazy iron
rapid sky
#

(i will have a thing that recieves packets and puts them in a list on the other side)

prisma cobalt
rapid sky
#

Im sending files so im splitting the bytes objects from open(path, 'rb') into 1kb chunks

prisma cobalt
#

sounds like a good plan 👍 maybe consider renaming packet_list to file_chunk_list or something as it implies something else

rapid sky
#

Ok. I named it that cuz i thought i had to do tcp myself

#

Thanks!

prisma cobalt
#

np

cloud spruce
# rapid sky (i will have a thing that recieves packets and puts them in a list on the other ...

when using tcp or udp sockets you don't send packets yourself (you would need a raw socket for that, but don't, because then you need to create all the packet headers of the different layers yourself)
you just send data that is handed to the OS network stack to send it over the network using the protocol that you specified
tcp is a stream protocol, you don't need to chunk it yourself to fit into each packet, you just send relative large chunks of data to the OS network stack and it will take care of chunking it to fit the network path packet size for you

pale gorge
#

Agreed. 👍

Though, How about instead of the sockets being integrated in the OS Network Stack, we get them through a different pathway??

ember ledge
#

where can i learn about implementing peer-to-peer encryption in Python? i wanna make a chatting system with p2p encryption

cloud spruce
cloud spruce
#

this is even more of a problem when it comes to asymmetric encryption, which you would most certainly need to be able to scale such a project and not require participants to exchange a shared key with each other outside of that system before they can securely communicate with each other

edgy pelican
ember ledge
edgy pelican
edgy pelican
#

so the main problem you'll probably have is ensuring the other person is who they say they are

edgy pelican
# ember ledge Eivl told me about Diffie-Hellman key exchanges, which were simple to make using...

generally a 2-way authenticated key exchange goes something like this

before the connection, both sides have an "identity" public & private key of a signature algorithm

when the connection starts:
person 1 creates a "signed" ephemeral key by generating a diffie-hellman key pair, and signing it with their identity signature private key and sends it to person 2

person 2 creates a signed ephemeral key by generating a diffie-hellman keypair and signs it with their identity private key and sends it to person 2

both sides verify the key pairs are valid (come from the correct person) by using the identity public key

both sides combine their diffie-hellman keys to get a secret``` and then you can use whatever fancy shit to sustain the session

the problem is you need some way to make sure the other person's identity key are valid, and it isnt another person masquerading as person 1/2

usually this is done by a centralized key server/certificate authority, aka someone both sides can trust
ember ledge
#

i'll try figuring that out

edgy pelican
#

key exchange is hard

#

the way signal does it is firstly naively trusting the centralized server, and if you dont want to trust the server, you can give the other person your public key by a qr code

#

the way whatsapp does this (dont fact-check me on this) is it uses key transparency to make a stronger assumption that the centralized server isnt lying to you

cloud spruce
cloud spruce
# ember ledge oh damn

yeah, this isn't easy stuff and there are lots to think about like timing attacks and other side channels that can leak sensitive information such as the keys or at least hint at what they can be or contain

then you have algorithms, you want something strong that is tried and true, but you probably want to combine it with something newer as well that is hopefully quantum resistant (also called post-quantum), this is how Signal does it nowadays since the newer algorithms hasn't proven themselves during enough time yet, and they derive different keys to use for the different algorithms (layers of encryption) just incase any of the layers could be broken and reveal the private key for it

this is all just used to be able to exchange a shared ephemeral key for the symmetric encryption used to encrypt the actual data that you want to send, as we have only been talking about asymmetric encryption (private and public key pairs) before

cloud spruce
# ember ledge duh

you might think that was a joke or a sarcastic question, maybe partially it is but in a jokingly manner, but i think it's also a very true and sincere question, because it's fine and even very encouraged if you want to tinker with this stuff to learn, especially long-term, just know not to use it for anything sensitive that you need to be properly secure without extensive prior knowledge and probably decades of experience in the field and peer review

the last point there is key, don't try to make it secure by keeping the implementation a secret, it's never a good recipe for true security, it must be able to withstand thural investigation/examination/review and the only thing that must remain a secret should be the keys
unless it can live up to that it shouldn't be deemed secure and used for anything remotely sensitive

edgy pelican
ember ledge
cloud spruce
tranquil prairie
#

what percent of android phones globally run on android 10 and lower vs android 10 and higher
not just the us and eu

lyric oak
carmine sapphire
#

hi

errant bayBOT
#

:incoming_envelope: :ok_hand: applied timeout to @carmine sapphire until <t:1741562806:f> (10 minutes) (reason: duplicates spam - sent 4 duplicate messages).

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

cloud spruce
#

!rule 5 9

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.

9. Do not offer or ask for paid work of any kind.

ember ledge
#

my grandma's got a phone which has android 8 and is OOW

#

she only uses it for calls/whatsapp, and I mean only those two

#

yeah

ancient fjord
#

why doesnt aiohttp support http/2😭

timid garden
#

quick question about the sockets library does .recv(port) waits for the next recieved package or prints the package that was sent that second if there was one

shy pebble
#

Assuming you're using TCP, recv gives you some amount of bytes. If there are bytes that were received and not yet read, you'll get them immediately.
It is important to keep in mind that recv doesn't work in terms of packets. You can get bytes from multiple packets, only part of a packet, etc.

#

@timid garden ^

spring blaze
#

Hi

#

anyone know how make click farm for youtube on python

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.

tranquil prairie
#

im thinking about starting to make a resume and upload projects, what are all the avenues. Github Repositories, Resume, anything else?

cloud spruce
graceful kayak
#

Not sure this is the correct channel, but I wouldn't now which is, so I apologize beforehand if it's not.

The below code:

import subprocess

command = "coverage run -m unittest && coverage report --fail-under=80"

code = subprocess.run(command, shell=True, check=False, stdout=subprocess.DEVNULL, stderr=subprocess.STDOUT).returncode
print(code)

Is yielding 5.
According to POSIX standards, 0 is success, and 1 is errors. What the hell is 5? lol

coarse summit
#

maybe?

graceful kayak
# coarse summit https://stackoverflow.com/questions/61432870/program-exited-with-code-5-geany-wi...

It was a unittest thing: https://docs.python.org/3/library/unittest.html#unittest.main

An exit code of 5 indicates that no tests were run or skipped

coarse summit
#

👌

lapis osprey
#

launched a networking simulation to my portfolio, anyone thats ever played with Cisco packet tracer let me know if they think its neat!

https://bschr.dev/vpt

muted topaz
#

I want a charged card checking tool?

woven ferry
#

hey, guys. I dont know if this is a feasible idea, but I’ve been thinking about distributed computing and how services handle large-scale processing. I recently came across a scenario where a server handles tasks like decoding audio streams, adding metadata, and compressing files, which seems pretty CPU-intensive. I’m curious about the possible ways to offload this workload efficiently.

In particular, I’m wondering:

  • How would you approach implementing a system where clients handle more of the processing to reduce server load?
  • What are the challenges with ensuring stability and security when distributing tasks to untrusted client devices?
  • Are there better ways to optimize real-time decoding and file generation across multiple machines?
    I’d love to hear any insights or resources on tackling this kind of problem, like when an app doesn’t provide an open API. Are there any common approaches or concepts for interacting with services in that case?
slow light
# woven ferry hey, guys. I dont know if this is a feasible idea, but I’ve been thinking about ...

From experience, all CPU intensive tasks need to be managed using some king of task queue such as celery https://github.com/celery/celery , so you have more control of the resources and how many jobs can run simultaneously to avoid having the server hanging.

  • For security, are there any performance consideration ? Sending data over https shouldbe enough in termsof security, you can maybe add some symmetric encryption on top between you and the client device to further enhance it in case the client's device is compromised.

  • If it's possible to split the data you can have a Kafka cluster deployed and run processing in parallel on the audio streams. Or if it doesn't need to be realtime something like Pyspark https://spark.apache.org/docs/latest/api/python/index.html where you process the data in parallel and aggregate results

GitHub

Distributed Task Queue (development branch). Contribute to celery/celery development by creating an account on GitHub.

lyric oak
# woven ferry hey, guys. I dont know if this is a feasible idea, but I’ve been thinking about ...

That has been documented in books like Architectural Patterns as "master-slave" pattern, and usually you need to maintain a bunch of hosts and assign different roles to them in that pattern, https://www.oreilly.com/library/view/architectural-patterns/9781787287495/cab8e24d-5814-49ac-8514-2f3a0f1d9076.xhtml and https://en.wikipedia.org/wiki/Master–slave_(technology). Libraries like Celery might give you some building blocks to implement that pattern, but without enough context you might get lost.

sweet breach
#

and make it flexable? because it acts weird on smaller screen or if zoomed in

lapis osprey
willow flare
#

Heya! I'm curious to know how a service like Discord works. How does their server handle so many wss connections at once?

#

For sending a message, I understand that the client can establish a connection and then send the message and then close the connection and repeat this however often they want.

#

Yes the handshakes will be expensive but at least the server won't get so much load.

#

But I cannot think of something similar for reads.

#

I presume that Discord has like 100k+ users active at the same time.

#

Just how many wss connections can a single server handle and how?

#

ping me btw, thanks :)

hollow hedge
hasty quest
#

The answer is download more RAM

#

Also, loadbalancers (the actual work is split amongst many servers), and cloud scaling (more load -> deploy more servers)

willow flare
#

Or do they allow 100k+ ppl to connect simultaneously?

slow light
# willow flare Or do they allow 100k+ ppl to connect simultaneously?

This should give you some idea of their approach: https://blog.bytebytego.com/p/how-discord-serves-15-million-users

Measuring GenAI Code’s Impact: Free Workshop (Sponsored) How is GenAI impacting software development? Join LinearB and ThoughtWorks’ Global Lead for AI Software Delivery to explore the metrics showing AI’s impact, unpack best practices for leveraging AI in software development, and measure the ROI of your own GenAI initiative.

neon dust
ancient fjord
#

I've found another networking library

#

that supports http 1.1 / 2/ 3

#

async + sync

#

its not as good as aiohttp on performance for http 1.1 but it beats it with multiplexing on http2

#

It's a really cool project, Im surprised nobody knows about it

neon dust
#

There's a lot out there in the HTTP space.

#

Even in the early days, you had a number of options for servers.

ancient fjord
#

when you lookup for async http libraries you only hear about aiohttp or httpx

neon dust
#

fasthttp?

ancient fjord
neon dust
#

Looked like there was a binding for it.

ancient fjord
#

doesnt seem async

ashen widget
queen forge
#

Hi guys, does anyone here know about the facial recognition library? I have a project to show to my teacher today, I tested this application before, but today it keeps giving an error, I don't know what to do. I'm using flask and psycogap2

patent temple
#

how can i fetch all solana transactions as csv

strange fulcrum
narrow ridge
#

Is there a library or a way for me to automatically records all my external api calls like when I use requests or httpx?

errant bayBOT
#

Automatically mock your HTTP interactions to simplify and speed up testing

Released on <t:1735603677:D>.

narrow ridge
narrow ridge
# slow light You can check vcrpy

Wait so I use this python library for twilio, is it possible that I can record interactions with it as well, or I'll have to mock it instead?

#

!pip twilio

errant bayBOT
#

Twilio API client and TwiML generator

Released on <t:1742466949:D>.

vocal kernel
#

Is someone working with netmiko or paramiko?

slow light
pale gorge
#

Does anyone know how to get Google Speech-to-text imported in Python?

vague cedar
#

Probably not the right channel.

pale gorge
#

👍

vague cedar
pale gorge
#

Ah, Thank You. Appreciate the help.

rapid sky
#

Im using the example code from the http.server docs

import socketserver

PORT = 8877

Handler = http.server.SimpleHTTPRequestHandler

with socketserver.TCPServer(("", PORT), Handler) as httpd:
    print("serving at port", PORT)
    httpd.serve_forever()```
but I can only access the server from within my LAN. whats going on?
vague cedar
#

When you say "", TCPServer listens on 0.0.0.0, which is all the network interfaces on the machine. If you're not routing traffic to that machine from your internet router, it will only be reachable inside your LAN because your machine presumably has only private IP addresses.

rapid sky
vague cedar
lyric oak
coarse summit
#

Hey, im trying to see which requests a website is sending, but some of them aren't showing on networking dev tools, are there any ways to hide them?

vague cedar
#

networking dev tools as in the network console in your web browser? Just making sure.

#

Make sure the 'All' filter is checked and that you don't have anything in the search field narrowing it down

#

Also you may want to use 'disable cache' if any requests might just be getting served from that last response without a network request

#

Whether that's happening or not is kinda based on the circumstances

coarse summit
vague cedar
#

OK yeah then that's not it.

coarse summit
#

im confused

vague cedar
#

There's a 'Restore default and reload' thing under the gear icon if this is Chrome, it might help

#

Also are you sure the request is really happening? You could use Wireshark to verify.

#

also there's an "only show requests with SameSite issues" thing that could hypothetically accidentally be on?

coarse summit
vague cedar
#

and you're receiving the request on the server-side, I take it?

coarse summit
#

not my site

#

that's the issue

#

would imply function (R) is getting called right?

vague cedar
#

yeah but does N(...) make a network request, or just set one up? It's hard to know from that

coarse summit
#

im trying to check that

#

it appears to be using XHR

#

it sends XHR request but just for metrics

vague cedar
#

At this point I would break out Wireshark and just double-check the request is really happening

vague cedar
#

That's really strange, I don't know of any way off the top of my head to 'hide' from the Chrome network console from client code

coarse summit
#

ill try a mitm

vague cedar
#

Sorry I have to run for a bit, but I'll think about this while I'm away

#

Oh hmm.. I guess a Service Worker can do this?

#

They can intercept network stuff before it gets to the inspector I think

#

Can you
A) try looking for Service Workers on the Application tab
B) try Firefox just for grins?

coarse summit
#

ill try to investigate on service workers

#

hmm no service worker running

#

im lost

high night
#

I want to make a hd 2r game in pycharm is it possible

autumn idol
#

Good day Folks, I am new to programming and i would like to learn python for automating tasks in the security engineering. Can anyone please suggest me the good place to begin.

I have no prior knowledge in coding

vague cedar
lyric oak
warm stream
#

Hey people
I need a help regarding Pysnmp. Actually I have downloaded Pysnmp but I can not use built-in functions.
Despite installing different versions I am still lost.

https://stackoverflow.com/questions/79560473/problem-in-implementing-smnp-pysnmp-in-my-code

warm stream
vague cedar
#

From your error image, nextCmd appears to be part of pysnmp.hlapi.asyncio not pysnmp.hlapi. You need to import more stuff, and I suggest not using * with imports in general while you're at it.

errant bayBOT
#

docs/source/docs/pysnmp-hlapi-tutorial.rst line 45

['bulkCmd', 'getCmd', 'nextCmd', 'setCmd']```
tulip holly
#

Excuse me, sir. I am currently developing an API using Flask and MongoDB with the flask-mongoengine library, but I encountered an error: OSError: [WinError 10038] An operation was attempted on something that is not a socket. Do you happen to know how I can resolve this issue, sir?

#

Here is the error I received.

tulip holly
coarse leaf
#

How did we read sender address from udp socket while using loop.sock_recv in python 3.10 version?

loop.sock_recvfrom is added from 3.11 version.

#

Does AbstractEventloop had asynchronous datagram support in 3.10?

tulip holly
coarse leaf
coarse leaf
vague cedar
#

I guess if you have an async “receive stuff” function you can do something like:

    with ThreadPoolExecutor() as executor:
        data, addr = await loop.run_in_executor(
            executor, 
            lambda: sock.recvfrom(max_size)
        )
coarse leaf
#

I have created a little test script to calculate the server time on client side. This code is computation part. Can someone who have worked on synchronising server time on client side or related knowledge can review my code: https://paste.pythondiscord.com/WPMQ

prisma cobalt
cedar raft
#

hi idk if this is the right place for this

#

im upgrading a chat system somone else built and right now the server and the client work good as long as they are both started on my pc(dont even have a secound pc if it works using diffrent pc's on same network)
what i want is for me to start the server script and my friend to be able to start the client script and connect to the server script i started

cedar raft
#

ok so what should i do

vague cedar
#

In the end it creates a secure route for your requests, but before that the setup is a bit different due to its focus on identity

#

Hmm, Funnel still uses HTTPS though, I guess that might require you to modify your client code

#

I'm trying to think of the least-work approach for you to get up and running

cedar raft
#

well i really dont mind modifying it

#

the thing is as its a personal project just me and maybe 1 or 2 friends will test it

#

idk if we will even use this so that one friend will have tailscale thats not that big a deal

#

although in the future i would like for more of my friends to want to join as i upgrade the code

vague cedar
#

Yeah, I guess just expecting both the client and server to 'have' Tailscale at the moment is the easiest way

cedar raft
#

but if you could help me now that would be great thank you so much i appriciate it a lot

vague cedar
#

(not necessary if the client is inside your network already)

cedar raft
#

alr well lets just assume my friend has tailscale for now

#

how would i got bout that

vague cedar
#

How far have you gotten on that 'install' page?

cedar raft
#

installation complete

vague cedar
#

OK, and you added your Windows machine as a 'device'?

cedar raft
#

hold on let me have a look just a moment

vague cedar
#

https://tailscale.com/kb/1312/serve this is the serve command you're going to want once you're set up
If your app is running on your laptop on port 12345, you'd type tailscale serve 12345

#

This also uses HTTPS, I'm not 100% sure which tools have an approach that doesn't use it.. it's super common to see it this way.

cedar raft
#

ok yes my laptop is on and connected

#

its running on 5050

vague cedar
#

OK, try running tailscale serve 5050 in a command/terminal window

cedar raft
#

does my server for the chat system need to be open or no before i run the command?

#

what do you think?

vague cedar
#

Hmm. It needs to be open before it will work, but I'm not sure if serve will check first to see if it's running or not.

#

I'd launch the server first the first time, you can try the other order later

cedar raft
#

yea alr ill open it then run the command

#

ok hold on i need to go enable server

#

serve

#

ok done

#

now what

vague cedar
#

Now in another window/terminal, you can launch the "client" code, and have it connect to laptop.taild16507.ts.net on port 443

cedar raft
#

why port 443 tho?

vague cedar
#

Because of the 'https' that tailscale stuck on there.

cedar raft
#

what about the header?

vague cedar
#

what you want is tailscale serve --tcp 5050

#

Try that instead

cedar raft
#

Serve content and local servers on your tailnet

USAGE
tailscale serve <target>
tailscale serve status [--json]
tailscale serve reset

Tailscale Serve enables you to share a local server securely within your tailnet.

To share a local server on the internet, use tailscale funnel

<target> can be a file, directory, text, or most commonly the location to a service running on the
local machine. The location to the location service can be expressed as a port number (e.g., 3000),
a partial URL (e.g., localhost:3000), or a full URL including a path (e.g., http://localhost:3000/foo).

EXAMPLES

  • Expose an HTTP server running at 127.0.0.1:3000 in the foreground:
    $ tailscale serve 3000

  • Expose an HTTP server running at 127.0.0.1:3000 in the background:
    $ tailscale serve --bg 3000

  • Expose an HTTPS server with invalid or self-signed certificates at https://localhost:8443
    $ tailscale serve https+insecure://localhost:8443

For more examples and use cases visit our docs site https://tailscale.com/kb/1247/funnel-serve-use-cases

SUBCOMMANDS
status View current serve configuration
reset Reset current serve config

FLAGS
--bg, --bg=false
Run the command as a background process (default false)
--http uint
Expose an HTTP server at the specified port
--https uint
Expose an HTTPS server at the specified port (default mode)
--set-path string
Appends the specified path to the base URL for accessing the underlying service
--tcp uint
Expose a TCP forwarder to forward raw TCP packets at the specified port
--tls-terminated-tcp uint
Expose a TCP forwarder to forward TLS-terminated TCP packets at the specified port
--yes, --yes=false
Update without interactive prompts (default false)

Tailscale

Learn how Tailscale Funnel lets you share your files and services with the internet.

vague cedar
#
  --tcp uint
        Expose a TCP forwarder to forward raw TCP packets at the specified port
``` is what we want
#

5050 is your uint (unsigned integer)

cedar raft
#

ok well i thats what i got from that command

#

tailscale serve --tcp 5050(this command)

vague cedar
#

OK try tailscale serve 5050 --tcp, maybe it wants those options after the port number

#

But that's not what the help says so I'm confused

#

surely you don't need tailscale serve 5050 --tcp 5050 that seems weird

cedar raft
#

invalid argument format

vague cedar
#

Oh apparently you DO need to repeat it

#

Try that last one that I said was weird

cedar raft
#

tailscale serve 5050 --tcp 5050
Error: invalid number of arguments (3)
try tailscale serve --help for usage info

vague cedar
#

Baffling

#

Try tailscale serve --tcp 5050 localhost:5050?

cedar raft
#

C:\Users\Proba>tailscale serve --tcp 5050 localhost:5050
Available within your tailnet:

https://laptop.taild16507.ts.net:5050
|-- tcp://laptop.taild16507.ts.net:5050 (TLS over TCP)
|-- tcp://100.78.230.13:5050
|-- tcp://[fd7a:115c:a1e0::7201:e60d]:5050
|--> tcp://localhost:5050
Press Ctrl+C to exit.

vague cedar
#

Cool. I would try 100.78.230.13:5050 first from the client.

#

So set 100.78.230.13 as the SERVER_IP and 5050 as the PORT

cedar raft
#

alr

vague cedar
#

The '100.' address is the one Tailscale assigned to your machine

cedar raft
#

C:\Users\Proba\Desktop\ctf>python client.py
Enter your username:
testing1
Traceback (most recent call last):
File "C:\Users\Proba\Desktop\ctf\client.py", line 88, in <module>
send(temp)
File "C:\Users\Proba\Desktop\ctf\client.py", line 25, in send
client.send(message)
ConnectionAbortedError: [WinError 10053] An established connection was aborted by the software in your host machine

#

when i tried opening a client on my machine

vague cedar
#

Yeah, hmm. My guess is that that's the TLS/SSL, let me ponder the quickest way to check that

cedar raft
#

which if im gonna talk to my friends on it, i will also need

#

ok thank you so much

vague cedar
#

Hmm, do you happen to have the openssl command installed on your machine? You probably don't as it's Windows..

#

openssl s_client -starttls -showcerts -connect 10.78.230.13:5050 is the command I'd like you to run

#

but I'm trying to think of the built-in Windows equivalent

#

I guess if you can launch PowerShell and try this? Test-NetConnection -ComputerName 10.78.230.13 -Port 5050

#

That's not exactly the same thing but might tell us something

cedar raft
#

Test-NetConnection :: 10.78.230.13 Ping/ICMP Test Waiting for echo reply

#

PS C:\WINDOWS\system32> Test-NetConnection -ComputerName 10.78.230.13 -Port 5050 WARNING: TCP connect to (10.78.230.13 : 5050) failed WARNING: Ping to 10.78.230.13 failed with status: TimedOut

ComputerName : 10.78.230.13
RemoteAddress : 10.78.230.13
RemotePort : 5050
InterfaceAlias : Wi-Fi
SourceAddress : 192.168.0.56
PingSucceeded : False
PingReplyDetails (RTT) : 0 ms
TcpTestSucceeded : False

#

shouldnt it be 100.78.230.13 instead of 10?

vague cedar
#

Oh yeah my bad

#

typo

cedar raft
#

ComputerName : 100.78.230.13
RemoteAddress : 100.78.230.13
RemotePort : 5050
InterfaceAlias : Tailscale
SourceAddress : 100.78.230.13
TcpTestSucceeded : True

vague cedar
#

OK, that looks good.. Now the question is whether it has TLS/SSL on it or not.

#

On Windows, the best approach I can come up with is to install a powershell plugin, if you're OK with that

cedar raft
#

sure ig

#

so what do i need to do

vague cedar
#

Hmm, testing it now on a Windows machine and it doesn't work the way I want

#

I use MSYS2 on Windows so I have all these commands, it's taking me a minute to figure out what to do on a 'bare' Windows install

cedar raft
#

alr thank you so much i appricaite what you are doing

vague cedar
#

OK how about this..

cedar raft
#

would you like the code so you can test it?

vague cedar
#
$tcpClient = New-Object System.Net.Sockets.TcpClient
$tcpClient.Connect("100.78.230.13", 5050)

# Send STARTTLS command if needed (depends on protocol)
$stream = $tcpClient.GetStream()
$writer = New-Object System.IO.StreamWriter($stream)
$reader = New-Object System.IO.StreamReader($stream)
$writer.WriteLine("STARTTLS")
$writer.Flush()
$response = $reader.ReadLine()

# Create SSL stream
$sslStream = New-Object System.Net.Security.SslStream($stream, $false)
$sslStream.AuthenticateAsClient("100.78.230.13")

# Display certificate information
$cert = $sslStream.RemoteCertificate
$cert | Format-List

Save that as 'checkcert.ps1' or any filename of your choice ending in .ps1 (the powershell script file extension)

#

then you can run it with c:\example_path\checkcert.ps1. Depending on your setup you may need to enable running scripts in powershell first

cedar raft
#

will my friend who will also have a client need to run this as well

vague cedar
#

Nope, this is just so we can understand what's going on

#

If you get an error saying that script execution isn't enabled, you can run Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser to turn that off

#

Set-ExecutionPolicy -ExecutionPolicy Restricted -Scope CurrentUser will set it back to the default later if you want.

cedar raft
#

i cant get it to work god damn it

vague cedar
#

I'm probably missing some nice Windows trick here.. This is super straightfoward on UNIX systems. Hmm.

cedar raft
#

you know how to run this on lets say ubuntu server?

vague cedar
#

Yeah

#

But Windows should work fine, it's just low on debugging tools out of the box

cedar raft
#

can you write a step by step guide from start to finish?

vague cedar
#

Sure, is the code somewhere I can look at? That will let me tailor it better.

cedar raft
#

i might be able to get my hands on anouther laptop running ubuntu server

cedar raft
vague cedar
#

We could also try using something simpler than Tailscale at first

#

Tailscale is a whole zero-trust network with a lot of features

cedar raft
#

well on the ubuntu server other than this program i also want to be able (for the same friend same situation) to be able to connect to my jellyfin

vague cedar
cedar raft
vague cedar
#

Even on Ubuntu we still need 'something' to help us route traffic in from the internet, e.g. ngrok, tailscale, pinggy.. but that should all work. Jellyfin is pretty easy.

cedar raft
#

well if you have something that you know works ill use it

#

ill send you the code if youd like and if you can write a step by step guide ill do it

vague cedar
#

Well, I know Windows works too, it's just a matter of configuring things to suit your custom code

cedar raft
#

but again ill probably get my hands on anouther machine soon and it will run ubuntu server sssooo

vague cedar
#

Pinggy LOOKS like it will let you create a tunnel that doesn't use TLS

#

That's the problem we're facing right now with Tailscale, is that your client is trying to connect in the clear, and bumping into a secure handshake it wasn't expecting

#

I wanted to prove that with that openssl command but oh well, let's just assume that's the situation

#

If you have Wireshark you can also use that to check but we don't need to get into that if you don't already have it

cedar raft
#

thats why if you have something diffrent that you know works ill use it

vague cedar
#

OK then yeah at least on Ubuntu we'd be able to easily connect to your tailscale port and see what it is saying

#

The powershell thing I pasted should have worked but I guess that's a whole ecosystem to get familiar with

cedar raft
#

yea i guess so

#

so if you know something that i can use and make a step by step guide for ubuntu server that would be great ill send you the server code and the client code on dm now

vague cedar
#

OK sure I will try to write it up

cedar raft
#

ok thank you very much

vague meteor
#

Hello, I tried deploying a website using a windows virtual machine at azure and the public ip address the website is working fine but after changing dns, the website is still not live, can someone please guide me 🙂

prisma cobalt
quick silo
#

hello guys i need serious help, has some here ever made a zero trust architecture in network topology using mininet and ryu controller.

peak iron
#

could someone help me to not get this eror anymore i tried copilot but he cant do it

errant bayBOT
peak iron
#

its on visual studio 2022 profesional wpf

lyric oak
vague cedar
warped rock
#

hello

sweet breach
#

hello

fiery pivot
#

Topic - HTTP 1.0 vs HTTP 1.1

Hi so i have been reading that what makes keep alive connection better that HTTP 1.1 provides , so i was reading this paper from https://ant.isi.edu/~johnh/PAPERS/Heidemann97a.html

and it says that initially HTTP 1.1 was slower than HTTP 1.0 because of some errors at the application layer that server was sending two segments one full MSS (maximum segment size) which contains the content and another which contains only the header (in the initial packets) now it says that client doesnot sends an acknowledgment right away if it gets a partial segment, and if that happens it adds a 200ms ack delay, which was initially cauing HTTP1.1 to be slower, but i dont understand why the same problem was not faced in HTTP 1.0?

lilac sail
#

Hey.
My ISP gives me a new IP every time I reboot the router.
Is there a way I can get a new IP without rebooting the router?
Because rebooting takes 30 seconds, and I need a new IP every second. Is that possible?
(i dont want to use proxies from internet)

vague cedar
#

Super interesting paper by the way, thanks for the link

#

My understanding is now this, if this helps at all:

  • Early HTTP servers used stdio, merging multiple small user-level writes into fewer big syscalls, avoiding partial segments in the first place
  • HTTP 1.0 closes the connection at the end of each response.. clients don't delay ACKs on FINs, so this ACKs all pending data immediately
  • With no persistent connections, partial segments and mid-stream weirdness doesn't get a chance to happen
#

So I guess once cooler/later servers stopped isolating headers in separate segments, this all went away?

exotic yew
#

!rule 9

errant bayBOT
#

9. Do not offer or ask for paid work of any kind.

pulsar hornet
vocal kernel
#

Oh. Found about ipaddress module in python today. Good that I do not need to regexp match the IP address to validate it.

hasty quest
#

your ISP will kick you to the curb if you fuck with their address provisioning

#

And there is literally no reason you'd need an address every second. Switching addresses faster doesn't help you avoid being counterhacked or traced or whatever, this isn't a shitty TV show.

summer aspen
#

I writed the following code for dealing with socket, socket do not accept iterable objects, only a subclass of tuple and i need the ipaddress validation and version check logic. Now I'm thinking is ipaddress module is good solution?

import ipaddress
import socket
import enum




class AddressVersion(enum.IntEnum):
    IPv4 = 4
    IPv6 = 6


class Address(tuple):
    def __new__(cls, hostname: str = "0.0.0.0", port: int = 0, version: int = AddressVersion.IPv4, flow_info: int = 0, scope_id: int = 0):
        instance = super().__new__(cls, (hostname, port))
        instance.hostname: str = hostname
        instance.port: int = port
        instance.version: int = version
        
        if version == AddressVersion.IPv4:
            instance.flow_info: int = flow_info
            instance.scope_id: int = scope_id
        
        return instance
    
    def encode(self) -> bytearray:
        data: bytearray = bytearray()
        
        data.append(self.version)
        
        if version == AddressVersion.IPv6:
            ...
        
        return data
    
    def __str__(self) -> str:
        return f"{self.hostname}:{self.port}"
summer aspen
vocal kernel
#

For ipv6 match I think you can implement a check for something like this: [fd00:1245:4567:8901::2]:443. (Ipv6 address in braces) and port number after it.

#

And make sure you receive that and not other format.

summer aspen
vocal kernel
#

Is passed after the address. Yes.

summer aspen
#

Ipaddress only for ip address validation

#

If I were to write my own logic, I would use a regex pattern, but I'm not at all sure that it's not too overloaded for my project.

vocal kernel
#

Yeah. That was my idea.

half forge
lyric oak
fringe berry
#

Oh my bad! 🙂

hard rune
#

can someone help me learn sockets

proud swift
#

Do you have some code?

lyric oak
summer aspen
#

Hey!
I’m working on a network engine that aims to implement a reliable protocol over UDP.
In my design, each network message is represented by a class with typed fields and logic to serialize/deserialize itself into binary form.

Currently, I'm trying to design a clean, scalable architecture for:

  1. Registering message types (each one has a unique ID),
  2. Dispatching incoming binary data to the correct message class,
  3. And then calling the correct handler to process that message.

The challenge is: I want to avoid too much boilerplate or tightly coupling responsibilities. For example:

I don't want message classes to register themselves.
I want to follow SOLID principles (esp. SRP).
I’m not sure if I should rely on singledispatch, manual registration, or something else.

Has anyone tackled this kind of pattern before?
Would love to hear how you'd approach message-to-class mapping and message-to-handler logic in a clean way.

summer aspen
# summer aspen **Hey!** I’m working on a **network engine** that aims to implement a **reliab...

So Message class is a container for fields, can be serialized/deserialized to binary data, dispatcher is a class that looks at the message id (first byte, but the structure will be specified by the message class, dispatcher doesn't know about Message structure) and chooses the right message class to deserialize the binary data, Handler is a class that has some method, it knows how to handle some message types, but the class itself can't find out

class SomeHandler:
@HandlerManager.register
def handle(message: SomeType) -> None:
# Do some business logic

I also want to make the dispatcher and handler system consistent, but how? Maybe no need to register in HandlerManager.register, and HandlerManager will be a metaclass that will find the registry from Handler.handle, so Handler.handle will be the only method to send

summer aspen
gentle laurel
#

i used pickling to serialize my Message Class (make sure to not have a socket member because you can’t serialize it

#

pickle.loads and pickle.dumps

summer aspen
# gentle laurel i used pickling to serialize my Message Class (make sure to not have a socket me...

It's not a mine protocol, called RakNet, the networking engine written in C++, and I'm writing my own implementation in Python, so pickling isn't a correct solution, RakNet like other protocols, it has its own message structure and that's right, pickle is needed to just quickly get a fast implementation without going deep into protocols, but now I'm not working on the serialization and deserialization system, the dispatcher and the handler manager are the ones that send message instances or raw data to the right place

summer aspen
# gentle laurel i remade this in school today

If you using pickle that's ok, but in my case pickle has nothing to do with this, I probably asked the question in the wrong channel, because the question is about how to register message classes in the dispatcher? There is some class with an ID attribute and it is inherited from the base class Message, there are many ways to do this, besides, should the logic of the dispatcher roughly coincide with the logic of the handler manager, because they have similar tasks, this is also my question, for example, some of the ways can be Message__subclasses__() or Message.__init_subclass__() or metaclasses, or maybe even manual registration, this is more of an architectural question

summer aspen
shy pebble
gentle laurel
summer aspen
# shy pebble Is there going to be exactly one handler for every message type?

No, you can create a handler class and he can handle many types of messages, code example:

from RakNet.Protocol.Messages.Message import Message
# from RakNet.Protocol.Datagram import Datagram




class MessageDispatcher(type):
    messages: dict = {}
    
    def __new__(mcs, name, bases, attrs) -> object:
        cls = super().__new__(mcs, name, bases, attrs)
        
        mcs.messages[cls.id] = cls
        
        return cls
    
    @classmethod
    def dispatch(cls, data: bytearray) -> object:
        message: object = Message(data)
        
        message.decode_header()
        
        if message := cls.messages.get(message.id):
            return message.decode(data)

This is message dispatcher

from functools import singledispatch




class HandlerManager:
    @singledispatch
    @classmethod
    def handle(cls, message: object) -> None:
        ...

This is HandlerManager

from functools import singledispatch
from abc import abstractmethod, ABC
from RakNet.Protocol.HandlerManager import HandlerManager




class Handler(ABC, metaclass=HandlerManager):
    @staticmethod
    @abstractmethod
    @singledispatch
    async def handle(message: object, system: object) -> None:
        ...
    
    @classmethod
    @property
    def messages(cls) -> dict:
        return cls.handle.registry

This is abstract handler class

summer aspen
# summer aspen No, you can create a handler class and he can handle many types of messages, cod...

And this is example handler:

from RakNet.Protocol.Handler import Handler
from RakNet.Protocol.HandlerManager import HandlerManager
from RakNet.Protocol.MessageIndentifiers import MessageIndentifiers




class OpenConnectionReplyHandler(Handler):
    @staticmethod
    @HandlerManager.handle.register
    async def handle(message: OpenConnectionRequestReplyOne, system: object) -> None:
        peer._connection_event.set()
        
        if system.connection_state is not ConnectionState.PENDING:
            return
        
        system.connection_state = ConnectionState.CONNECTING
        system.mtu_size: int = min(peer.mtu_size, message.mtu_size)
        system.guid: object = message.guid
        system.security: bool = message.security
    
    @staticmethod
    @HandlerManager.handle.register
    async def _handle(message: OpenConnectionRequestReplyTwo, system: object) -> None:
        peer._connection_event.set()
        
        if system.connection_state is not ConnectionState.CONNECTING:
            return
        
        system.guid: object = message.guid
        system.mtu_size: int = message.mtu_size
        system.security: bool = message.security
        system.connection_state: ConnectionState = ConnectionState.CONNECTED
#

The exact question can be MessageDispatcher and HandlerManager consistent? Can both use same method for registration, i forgot give a message base class:

from __future__ import annotations
from RakNet.Utils.BinaryStream import BinaryStream




class Message:
    def encode_header(self, stream: BinaryStream | None = None) -> BinaryStream:
        stream: BinaryStream = stream or BinaryStream()
        
        stream.write_unsigned_byte(self.id)
        
        return stream
    
    def decode_header(self, stream: BinaryStream) -> Message:
        self.id: int = stream.read_unsigned_byte()
        
        return self
    
    def encode_payload(self, stream: BinaryStream | None = None) -> BinaryStream:
        ...
    
    def decode_payload(self, stream: BinaryStream) -> Message:
        ...
    
    def encode(self, stream: BinaryStream | None = None) -> BinaryStream:
        stream: BinaryStream = stream or BinaryStream()
        
        self.encode_header(stream)
        self.encode_payload(stream)
        
        return stream
    
    @classmethod
    def decode(cls, stream: BinaryStream) -> Message:
        message = cls()
        
        message.decode_header(stream)
        message.decode_payload(stream)
        
        return message
summer aspen
summer aspen
# gentle laurel You look through docs on their serialization?

Docs and reverse engineering now, but it doesn't matter, now I have a lot of architectural questions, including those related to the network, I have a lot of solutions and it is not clear which is better, each of them may have flaws or look strange, the architecture is very complex

shy pebble
#

where does the protocol state go in this architecture?

summer aspen
shy pebble
#

You have reliable UDP, there's something tracking at least ack numbers and such

#

that is an important piece of the architecture

summer aspen
#

Yes, it is, I'm working on reliability, but in RakNet there is a channel system where packets are divided into channels with unique identifiers, each of which has its own numbering, it is even more complicated there, because my library is asynchronous, not only is the architecture complex, but you also need to worry about asynchronicity, performance, code purity

summer aspen
#

Now it's two thousand lines of code

#

And i don't publish on GitHub yet

shy pebble
#

You have a lot of indirection that seems to amount to @functools.singledispatch, and that doesn't actually interact with the hard-to-architect part of implementing a protocol -- state management.

summer aspen
#

This is problem, complex architecture, complex questions, and there is not even a link to github or something like that

summer aspen
#

You can call it packet if you prefer

shy pebble
#

yeah, that makes sense

summer aspen
#

I don't know why, but I'm trying to link raw data processing and field processing, this may sound completely illogical

shy pebble
#

But if you're asking about architecture, I can tell you that registering a single function for every message type is not quite an ergonomic way to implement a protocol.

summer aspen
summer aspen
summer aspen
#

But this has nothing to do with the current problem, I tried to explain the problem clearly, but it seems to be unclear and vague, so I am very disappointed, I don't even know how to express my thoughts

shy pebble
#

I mean, if all you need is have one function per message type, you can throw that into singledispatch and it'll be fine

#

It's just a fairly annoying way to write a complex protocol

summer aspen
#

Interesting, how you imagine a universal handler function? Match-case or something else?

#

This is the point of protocols, there is no point in creating multiple types of messages if they can be processed in the same way, each message must have some purpose and be processed differently

shy pebble
#

Ah no, I mean sort of the opposite.
a common strategy I've seen looks like

class Handler:
    def on_connection_reply_one(self, msg: ...) -> Handler:
        raise self.invalid_msg(msg)
    def on_connection_reply_two(self, msg: ...) -> Handler:
        raise self.invalid_msg(msg)
    ...
class Connecting(Handler):
    def on_connection_reply_one(self) -> Handler:
        ...
        return Connected()
class Connected(Handler):
    def on_data(self, msg: ...):
        self.send_ack(msg)
        self.data_queue.push(msg.data)
        return Connected()
    def on_fin(self, msg: ...):
        return Disconnected() # maybe make it Optional and return None, up to you
...
``` it is a bit more boilerplate to get started (tho I'm sure there are many ways to reduce it), but the key is that each state has its own handling for messages.
#

it's not universal, but usually you will almost always end up with more abstractions than just message A calls on_message_A.

summer aspen
summer aspen
shy pebble
#

I would probably just not bother tbh.

slow fern
#

where should i start practising python

#

im really interested on it

foggy basalt
gentle laurel
summer aspen
summer aspen
gentle laurel
summer aspen
#

It more depends on prompt i think

carmine prism
#

fwiw i think it's gonna be hard to beat dict lookup performance-wise, e.g. going straight from the datagram to sth like dict[int, Handler]

#

singledispatch has some overhead

#

just uh.. guessing that performance is important for a UDP library

#

coming from somebody who just replaced almost all the fancy syntax sugar with dict boilerplate this week

#

your use case is different from what i'm working on (MQTT client) but i would still start with using builtins, dict is optimized to death

#

since MQTT is a complete protocol, i can do something like this to map the 4-bit identifier to a class which has a decode classmethod, you would have to build out this dict with registration; i don't know of a more efficient way to do this with pure Python

_ControlPacketClasses: Final[Mapping[int, type[MQTTPacket]]] = {
    MQTTPacketType["CONNECT"]: MQTTConnectPacket,
    MQTTPacketType["CONNACK"]: MQTTConnAckPacket,
    MQTTPacketType["PUBLISH"]: MQTTPublishPacket,
    MQTTPacketType["PUBACK"]: MQTTPubAckPacket,
    MQTTPacketType["PUBREC"]: MQTTPubRecPacket,
    MQTTPacketType["PUBREL"]: MQTTPubRelPacket,
    MQTTPacketType["PUBCOMP"]: MQTTPubCompPacket,
    MQTTPacketType["SUBSCRIBE"]: MQTTSubscribePacket,
    MQTTPacketType["SUBACK"]: MQTTSubAckPacket,
    MQTTPacketType["UNSUBSCRIBE"]: MQTTUnsubscribePacket,
    MQTTPacketType["UNSUBACK"]: MQTTUnsubAckPacket,
    MQTTPacketType["PINGREQ"]: MQTTPingReqPacket,
    MQTTPacketType["PINGRESP"]: MQTTPingRespPacket,
    MQTTPacketType["DISCONNECT"]: MQTTDisconnectPacket,
    MQTTPacketType["AUTH"]: MQTTAuthPacket,
}
#

as for message-to-handler, since this is a pubsub protocol, at the top level you are adding any number of callbacks keyed by topic filters; in your case you could register handlers keyed by classes instead

#

maybe i'm missing something though, at a glance RakNet also seems like a complete protocol, are you trying to implement another protocol on top of it or something?

#

@summer aspen

summer aspen
summer aspen
summer aspen
carmine prism
#

the usual way?

#

to answer the original question, i have tacked this kind of pattern before, and my approach was to map ints to classes to find the decoders and then bubble the messages up through callbacks, where each layer represents a different part of the lifecycle (in case of MQTT there are connection and session layers, then a top-level client layer which only sees auth and pubsub)

#

i'm not very familiar with RakNet but it looks like you could do something very similar, have layer(s) to deal with connection state and pings and such, then the actual data bubbles up to the public interface

lilac sail
#

Hello, can i use my router as proxy without using any clients connected to my router (without port forwarding)?

crystal current
#

Sounds like an XY problem... What is the actual problem you want to solve?

prisma cobalt
#

what website are you requesting? also share the code and we can help you debug

lyric oak
#

#rules Rule 9
Do not offer or ask for paid work of any kind.

#

You should use a freelancer site instead.

eternal shale
#

hello, anyone used a free web service from Render before? i made a face recognition web api with python, the web runs but the api itself didn't work? (it have simple web frontend and a face rec ai/ml using deepface)

so in the Render dashboard log, it said it runs the python app every some minutes after succesfully running on a http address. basically it stops the server and running again every now and then, i feel like its a memory issue (bc its free maybe? haha) but im not sure

real cedar
dull tapir
#

Yooo, I got a question. I'm trying to make an API that receives a video + some attributes, then post-processes the output and returns it back to the client. Can someone give me a tip on what I should look for to make this possible? I'm struggling a lot with this one T-T

errant temple
# dull tapir Yooo, I got a question. I'm trying to make an API that receives a video + some a...

Maybe start with a python client to interact with your API to do it? Might be quicker to sort out the problem there, just a script to upload your video and wait for the result. Then maybe when it takes too long and times out or something you can switch up your design a little bit, generate an ID and save it somewhere so that the client can check on the status of the processing of their video or something and point to where they can download it at. That's how I would start this simply and evolve it from there.

lyric oak
celest flame
#

Hello, I am exploring possibility of creating a web app to control a LAB environment, resource divide, scheduling, version control of the configuration and rollback to baseline configuration through NETCONF, TFTP or other means. Does anyone here have any experience with it?

dull tapir
#

Thank you @errant temple @lyric oak

lyric oak
celest flame
finite dock
#

prolly means things like ansible

celest flame
#

i have written a flask app that has GIT integration, configuration for devices is on there, uses netbox for inventory management and imports devices through API from there

#

then it's passed to ansible to reset the devices using configure replace tftp://<path> command

#

not all of my devices use NETCONF, so SSH and paramiko

#

was wondering if there is more elegant solution out there

#

in big short, git stores the local repo cloned from remote bitbucket to /srv/tftp location and netbox has all my stuff then passes it to playbook and triggers ssh connection to device telling it which file to get through TFTP and to trigger rollback to baseline

#

is there an easier way in mixed environment with different platforms like cisco, juniper, westermo?

vague cedar
#

Do all your devices have any single config mechanism in common, or are you for sure stuck with multiple “back ends”?

celest flame
#

I think I could go down to 3? IOS XE, IOS XR and JUNOS can use NETCONF, i can ditch SSH through playbooks for those but that still leaves me with Cisco IOS and Westermo OS, sooo 3 backends.

vague cedar
#

Gotcha. Yeah, that’s inherently a little tricky to make “clean”; all I can really advise is to plan your “configuration back-end” abstraction carefully.

celest flame
#

Yeah I figured, was kind of hoping for easy way out or an ideal, off the shelf solution falling into my lap

vague cedar
#

I’ve run into some products that kinda do this but only commercial ones. Not aware of an open solution.

celest flame
#

I vibe coded a solution that works but it's .. janky

regal forge
cerulean lily
#

oh nvm it works on ubunto

bright island
#

Hi I have a question - I'm not super into the network end of python but I'm starting to get into requests so I can try to scrape webdata and compile statistics based on the site's provided info - it's a niche game site so there's no public DB I could pull from other than what the site provides. I'm running into an issue where the site is only providing up to the 10th entry in a unit grid of ~30 total (I'll have to do this for multiple pages) - It appears the site is dynamically pulling the rest of the data when you're on the site in a browser but doesn't provide the entirety of that data when doing a simple request. I'm not sure how I'd be able to prompt the JS that's doing the data retrieval to grab the rest of what I need. anyone have any insight? Fairly simple code as of now as I'm just trying to pull the data before storing or doing anything with it to make sure I can even get what I need:

import requests
from bs4 import BeautifulSoup as BS

url = "https://www.beyondallreason.info/units/armada-bots"
response = requests.get(url)
data = BS(response.text, 'html.parser')

print(data)
inland rampart
#

I'd look at the network tab of your browser's devtools when that request is made, perhaps it can be trivially replicated

carmine prism
#

a BAR enjoyer

bright island
# inland rampart I'd look at the network tab of your browser's devtools when that request is made...

After looking around for a while I tried coming up with a POST request mimicking one of the POSTs in the networking tab but I'm running into a 404 here on this and the other POST attempt with a different API the site seems to be calling

import requests
from bs4 import BeautifulSoup as BS

umami_api_post = {
    "url":"https://api-gateway.umami.dev/api/send",
    "headers":{
        "Accept":"*/*",
        "Accept-Language": "en-US,en;q=0.5",
        "Cache-Control": "no-cache",
        "Content-Type": "application/json",
        "Origin":"https://www.beyondallreason.info",
        "Pragma":"no-cache",
        "Priority":"u=4",
        "Referer": "https://www.beyondallreason.info/",
        "Sec-Fetch-Dest": "empty",
        "Sec-Fetch-Mode":"cors",
        "Sec-Fetch-Site":"cross-site",
        "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:138.0) Gecko/20100101 Firefox/138.0"
    },
    "request": {
        "payload": {
        "hostname": "www.beyondallreason.info",
        "language": "en-US",
        "referrer": "",
        "screen": "1920x1080",
        "title": "Armada Bots ★ Beyond All Reason RTS",
        "url": "https://www.beyondallreason.info/units/armada-bots",
        "website": "895a9739-a0e0-4fdd-94de-d2eb780fa2a0"
        },
        "type": "event"
    }
}
response = requests.post(
    url=umami_api_post["url"],
    headers=umami_api_post["headers"],
    json=umami_api_post["request"]
)

print(response)

I'm fairly certain this should work but I'm not sure if I need to make a session or if I need to do some different calls before doing a post?

rapid sky
rain flume
#

.

vague cedar
quartz frigate
# rain flume .

It always has to be
It has to know where to go on the internal side of the NAT

quartz frigate
vague cedar
#

By probably I meant “definitely”, yeah

fallen ore
#

With databases can I use networking to update the database itself so if it's logged on to a different computer it's still connects that data

finite dock
#

externally exposed ones like mysql/postgres/etc

lyric oak
fallen ore
#

I'm using mysql so I don't know if it has an automatic hosting and I'm new to stuff like this and I'd never done networking

stiff mirage
#

You can connect and log in remotely (over the network) to a mysql database, yes. But you have to have that database exposed.

lyric oak
fallen ore
left swan
#

Hi, i want to make a game online, where a player is host, and another is client, without using a server. is it possible ? how do i do it ?

shy pebble
left swan
shy pebble
#

The simplest would probably be something like pinngy, but this isn't really a simple problem to solve.

left swan
#

Is making a server making differents 2p games at the same time hard ? And how would i host it ?

vague cedar
#

pinggy is a tool for exposing your private services/webapps to the internet.. along the lines of ngrok and others in the same realm.

#

pinggy is pretty cool because it doesn't really care what protocol you use. a lot of the options only really want HTTPS

lyric oak
glad steppe
#

I just updated to Ubuntu 25.04 last night and thus systemd networkd 257.4 and my IPv6 forwarding has broke - Anyone else hit this issue?

I saw and commented in https://github.com/systemd/systemd/issues/33414 - I've followed all the workaround here, but have not got my IPv6 forwarding back ... Any ideas?

tl;dr IPForward=yes seems deprecated, and you need to move to IPv[46]Forwarding=yes and set a default for each of those in networkd.conf / /etc/systemd/networkd.conf.d/forwarding.conf (I did the latter) ... All to no avail ...

GitHub

systemd version the issue has been seen with 256 Used distribution Arch Linux Linux kernel version used 6.9.5-arch1-1 CPU architectures issue was seen on x86_64 Component systemd-networkd Expected ...

cerulean lily
crystal current
rapid sky
wispy panther
prisma cobalt
# rapid sky ill probably do that then ive heard cloudflare is good?

Cloudflare is amazing but it depends what you want to host. Static HTML/CSS/JS is served free from Cloudflares cdn for free forever, they also offer a free tier of workers for a little bit more interactivity (this can include databases, buckets, and much more). If you have a python flask server or similar you'll need to probably rent a VPS somewhere, Hetzner is pretty cheap and does the job.
As for port forwarding, there's a guide I wrote that in this channels pins, I can walk you through it as well if that doesn't work

#

if you're wanting to host something yourself you'll need a static ip (or ddns)

fiery pivot
#

Topic - NAT (Network Address Translation)

So I get how NAT works - my router has one public IP and all my devices share it when connecting to stuff online. The router keeps track of which device sent what request and routes responses back correctly. But the same is not possible if someone tries to send data to my private PC without me asking for it.

But here's my question: Why can't we just tag our private IPs onto our public IP somehow? Like if my public IP is 203.0.113.5 and my PC's private IP is 192.168.1.10, why can't we use something like 203.0.113.5:192.168.1.10 to let people directly connect to my PC? Maybe that way we wont need TURN and STUN servers? I am sure there must be a very good reason for this but still curious

Is it just because routers aren't built to handle this kind of addressing, or is there some deeper technical reason this wouldn't work?

errant temple
# fiery pivot Topic - NAT (Network Address Translation) So I get how NAT works - my router ha...

Someone can correct me if this is wrong, but I think because the infrastructure the entire world is built on to understand only deals in a specific routing protocol which does not support that. In IPv4 you have 32 bits of information and none of them leave room to specify the internal IP address to connect to, and that's what we have available for routing, then on top of that specific protocol we have another one that is meant to be for a given application which the router (TCP or UDP) and those deal with none of that information. So with everything we have now there's nothing that can be used to route to specific addresses besides tracking which connections were initiated from where in the network. I think it's because .A) The protocol/infrastructure just doesn't exist and probably. .B) This subnet situation primarily exists to address the shortage of IPv4 addresses, with IPv6 there's more space for a lot more and everyone could. have a public one so it just isn't necessarily. But hypothetically there could probably be IPv[arbitrary-number] that has both the source ip, destination address, then actual destination address and it could work if routers were designed to use this arbitrary layer 4 protocol.

fiery pivot
errant temple
errant temple
fiery pivot
errant temple
# fiery pivot by shortage you mean that if we started to patch private IP with public IP it wi...

I mean since the reason we have subnets right now is because there aren't enough IP addresses to be assigned to every device, the solution wouldn't be to introduce entirely new variants of IP or transport protocol that every device would have to be modified to even use, the solution would just be to use version 6 of IP which has enough data sent per header to contain addresses of a larger size to be assigned, hence if you want people connected directly to your device, the solution is to not use a subnet, and to use IPv6 and have other people use IPv6, since there's 16 bytes of addresses and something like340282366920938463463374607431768211455 rather than only 4294967295.

fiery pivot
#

so you mean i patch my private IP in it?

#

that sounds cool

#

I'll have to read about it now haha

errant temple
fiery pivot
#

i mean if i use IPV6 i can patch my private IP In it?

errant temple
# fiery pivot i mean if i use IPV6 i can patch my private IP In it?

No. In IPv6 you still only have a source address and destination address in the packet, and if you have a subnet the addresses on it won't be accessible to the public still. But you would be able to have a public IPv6 address for every device if you wanted from your ISP because there's more addresses available.

fiery pivot
errant temple
#

Exactly

fiery pivot
#

makes sense

errant temple
fiery pivot
#

thanks this cleared some doubts, although am talking to another person talking about how it also causes privacy concerns

#

if it would have been possible

wispy panther
left swan
#

how do i host online for free a python socket server ?

sour ermine
#

hi developer
i couldnt connect to my database which is hosted on azure It couldnt connect with an error for timout even I have public ip access in azure

wintry oar
#

Hello, Anyone wants to collaborate in developing networking tools or scripts for our portfolio?

prisma cobalt
fiery pivot
#

Topic - need of ICE candidates when peers connected through SFUs in web rtc

Hey so i have been reading that how SFU solves the problem of peers sendind there feed to N-1 people, and share the ICE candidates with only the server instead of each other

But the question is in multiplayer gamees if the server processes the data and sends it to all players because its on a public IP so there is no NAT problem then why the same cant be happened when we are using SFU (a server to handle more than 2 peers) why we need manage ICE candidaates in that

i mean i dont get it , all peers talk to SFU and SFU returns data to them, you see? all are connected to SFU not to each other, they dont need to know about each other they know a public IP and can make a simple UDP connection with it , whats the deal here?

Why do i need to share my ICE candidates with the server? when it can talk to me without it as it does in games?

carmine prism
#

unfortunately there's no in between websockets and webrtc for unreliable transport, though theoretically you could fake a TURN server on the server side and use that instead of STUN, i looked into this a while back but never really answered the question..

#

and my understanding is most home users will need some way of getting UDP through NAT, if not ICE then some other homebrewed means which probably do the same thing

#

because there's no such thing as a UDP connection, just routing states which allow UDP to reach a destination

fiery pivot
carmine prism
#

and the short answer is you still have to send ICE candidates because you don't know if the server is behind the same NAT as you

#

actually, i guess not

#

send an empty list of ICE candidates and see what happens shrug

fiery pivot
carmine prism
#

the server sending datagrams back to the client may encounter a NAT, convention is a router will allow traffic back to the client on the same port it sent traffic from

#

this is not a connection, just a routing state which lasts until the NAT router(s) decide the state has ended

#

the combination of IP and UDP header gives you an implicit ICE candidate with every datagram, so you technically can't use UDP without implicitly sending at least one ICE candidate

#

and in the case of a relay server, this implicit ICE candidate should be enough to send messages back through a NAT

#

whether or not an SFU uses this implicit return address is probably an implementation detail

#

but it probably should, because the address in the headers is what the NAT is expecting to see

past spoke
#

anyone know the root of my problem for not being able to ssh?

#

(MacOs - > Windows 11 using OpenSSH)

#

the request always times out

#

ping and traceroute work

vague cedar
#

Can you ssh localhost on the Windows box? I guess that's the first test.

coarse summit
vague cedar
#

(I too briefly started with 300 baud, oof)

gentle elm
#

Hey guys a question, I am doing a project, and wanted to know, does anybody here know how to scrape post ids, of a myBB forum?

fiery pivot
#

topic - connection to webrtc SFU and signaling websocket

Hi so am trying to write a webrtc sfu server and for getting the SDP offer i need to use a websocket but am not sure how should i relay data from my tcp based websocket to my udp based sfu server?

prisma cobalt
fiery pivot
prisma cobalt
# fiery pivot Yeahh I did thought that but was just exploring the options. It just doesn't fee...

here's a snippet from one of my setups:

    socket.on(
        'transportConnect',
        async (
            { transportId, dtlsParameters }: { transportId: string; dtlsParameters: DtlsParameters },
            ack
        ) => {
            const transport = transportIdToTransport.get(transportId);
            if (!transport) return ack({ error: 'Not Found' });

            await transport.connect({ dtlsParameters });
            ack();
        }
    );

I have very tight socket io/medialink coupling

dusty lance
#

How else you could get access to the public network legally

#

Nowadays isp uses NAT as ipv4 itself isnt enough

fiery pivot
graceful crow
#

In my project, I wanted to detect outgoing requests from my device to a certain api's endpoint. I was wondering how I would go about doing that?

graceful crow
#

I realized that the "s" in "https" was made specifically to stop me. I gave up on that idea

gloomy root
#

well... the "s" technically can still let you do that

#

but it requires doing a MITM style decryption like you would have on some corporate system

fading whale
#

Hello

#

I am having doubt regarding project i dont no where to start

#

can anyone help me please

steady horizon
#

What is it

normal trout
#

Hey guys, I got a doubt...

I am trying to work with openssl python3.11.2v and I am trying to understand the codes since I am a newbie...

From what I see and what I want to know the encryption decryption happening is,
I use ssock.sendall(pt) and this input function returns to SSLSocket that uses def SEND to return self._sslobj.write(data)
...now from this, I don't understand much how things are carried forward for encryption decryption from SSLSocket sslobj.write stuff

lyric oak
normal trout
#

I do know python a bit but other Idk

lyric oak
cedar forum
#

!warn 1082970841010151525 Please see rule 9, you cannot post job adverts in this community.

errant bayBOT
#

:x: The user doesn't appear to be on the server.

calm raft
#

Hello

wild estuary
#

!rule ads

errant bayBOT
#

6. Do not post unapproved advertising.

torn iron
#

!rule list

errant bayBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

static hemlock
#

!rule

errant bayBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

errant bayBOT
#

The rules and guidelines that apply to this community can be found on our rules page. We expect all members of the community to have read and understood these.

steady totem
#

rule!

#

hello

hidden solstice
#

Hi! I'm having trouble... I was using Glitch til' now, but I need to change the web 'cause some new policies. So, I was wondering...
Do you know a web where I can...

  • Have my own backward server
  • Is free (or cheap)
  • Has a permanent link
  • Turns on auto when somebody enters (or it's on 24/7)
    ?

Thank you

fiery pivot
#

is it possible to make a webrtc connection between a client behind symmetric NAT and an SFU? without TURN servers , using only STUN

prisma cobalt
indigo river
#

hi, can someone help me creating a function that just grabs the ip of specific interface?

#

my script connects to a vpn, and there is a delay to get the ip, i need to wait for that and then get the ip, usually its tun0 interface

#

im using netifaces, but im having some errors with it , if anyone knows a simple way of doing that, i appreciate

hidden solstice
next jasper
upbeat elm
#

File descriptor in network programming working flow example ?

next jasper
wild estuary
#

my guy be asking for help the same way i google

upbeat elm
steady horizon
# upbeat elm Is select using for asynchronous multiple network request handling ?

Select has nothing to do with asynchronous programming.
It lets you queue I/O buffers and handle each one serially when selecting.
For network servers, it means you can have an infinite loop running as long as the server should, and check up on multiple client connections at the top of the loop, then inside handle each pending message not fully handled between the clients and the server.
A similarly behaving asynchronous server would schedule a handler task for every accepted connection and that handler task would loop pretty much indefinitely waiting for client messages, then answering them. This works because waiting in asynchronous programming means letting other tasks run in the meantime, so in the meantime other handler tasks could be resumed and then (continue to) write a message to a client.
With select you would be writing your own shoddy event loop, whereas with asyncio it's elegantly built into the module and has been refined for years by contributors who know what they're doing

prisma cobalt
#

I built my own using select, I don't think it's too "shoddy" lol
@upbeat elm an asynchronous server would be using some form of underlying socket selection to get around the blocking nature of read/write calls

next jasper
#

Select/poll are not shoddy, they're just low-level. They're literally being taught at uni when learning posix stuff :c that's why it was my first thought when I saw file descriptors and network programming...

#

Because higher level stuff won't use "file descriptors" directly, they'll be hidden behind some kind of abstraction

steady horizon
#

Yeah my bad I forgot asynchronous networking with sockets means nonblocking sockets polled with select

main hearth
#

Hello guys is there anyone who has yet taken the CCNA exam

harsh mountain
#

No.
have you?

hollow gulch
#

For the filterbar I am setting the parameters that you can filter by and I just want to know if I should add any more potential parameters. Im not network pro so I wanna know from you guys

#

Current paramters are

#

src_addr, dst_addr, length, flag, src_port, dst_port, protocol, and application

#

@whole mauve I showed you the app any thoughts?

whole mauve
hollow gulch
#

Yeah source and destination ports are there

#

they are just under info

#

if you remeber the I originally had it and a flag column to the right of the application column

#

but majority of packets are UDP so there wasnt any point in giving it its own column

#

so the format it like this now

#

its like this now ^

hollow gulch
#

or is there really nothing else to networking in terms of the info you can filter by?

whole mauve
whole mauve
hollow gulch
#

haha yeah it was a while ago

hollow gulch
#

I do realize this tool will actually make network cheating in video games a lot easier (generally a pretty exclusive community of people due to it being IMO a lot harder than traditional cheating) (NOT THE INTENDED PURPOSE OF THE APP I JUST FIND THIS A LOT OF FUN)

#

Do you know where I can find the other paramters to filterby?

whole mauve
# hollow gulch Well a little unethical but the length thing is something I wanted

Well I mean packet size and frame length themselves aren't unethical at all and are useful metrics depending on what you are doing since you can easily identify between certain packet types, data transfers, etc. Its just rare that one cares what the actual payload is in network troubleshooting since most often it is encrypted or just not relevant. Another filter would be MAC addresses as that is another common component used. And being able to filter by network (ie network/mask) and not just IP has a use as well.

Filtering by specific tcp flags is also useful. There are a number of other header specific filters depending on application like filtering for voice or you can get even more fancy like filtering for BGP messages or other routing protocols. to name a few. There are tons of different network packets and such so there isnt really one consolidated resource on filter options. It depends a lot more on target audience and purpose than anything else. Like if the main purpose is just snooping on a machine to see what traffic it is sending/receiving or can see that is different than like a packet analysis tool for diagnosing network problems.

hollow gulch
whole mauve
# hollow gulch Thank you so much for your input, its really been super helpful, and yeah I am g...

sure thing. And on that note the filtering is the most important for sure though not everything needs a column of course but a detailed view of each packet would be required. Taking a look at Wireshark would be a good idea since it is pretty much the defacto standard for (free) packet analyzers. If you wanted to expand on that into other product features then some report generation based on captured data has uses as well. classic stuff like 'top talkers' or top protocols, etc are also quite useful. And very deep packet analysis tools provide a lot of insight for things like that at the cost of rather expensive software packages 😉

civic basin
#

hi everyone, not sure if this is the right channel but im getting pretty frustrated with a difference between requests and httpx and can't figure out what's going on,

#

these two code snippets are somehow producing different results; the requests version gets a 200 while the httpx gets 403

#
        r = requests.get(url)
        print("requests headers:", r.request.headers)
        print("status code:", r.status_code)
        
        with httpx.Client() as client:
            r = client.get(url, headers={'User-Agent': 'python-requests/2.31.0', 'Accept-Encoding': 'gzip, deflate', 'Accept': '*/*', 'Connection': 'keep-alive'})
            print("httpx headers: ", r.request.headers)
            print("status code:", r.status_code)
#

i just copied over the headers to make sure everything was correct

cedar forum
#

well that does sound interesting

#

yeah i see no noticable differences here ```py

httpx.get("https://httpbin.org/get").json()["headers"]
{'Accept': '/', 'Accept-Encoding': 'gzip, deflate, br, zstd', 'Host': 'httpbin.org', 'User-Agent': 'python-httpx/0.28.1', 'X-Amzn-Trace-Id': 'Root=1-685c70f5-5777123a291fe65a0aa02441'}
requests.get("https://httpbin.org/get").json()["headers"]
{'Accept': '/', 'Accept-Encoding': 'gzip, deflate, br, zstd', 'Host': 'httpbin.org', 'User-Agent': 'python-requests/2.32.4', 'X-Amzn-Trace-Id': 'Root=1-685c70f9-1b1f037465615ef7590b7e57'}

civic basin
cedar forum
#

it gets weirder

civic basin
#

uhmmm

#

wtf

#

that's so wierd

#

how does this have different behaviours

        import requests
        import httpx

        url = "https://pubmed.ncbi.nlm.nih.gov/38035307/"

        r = requests.get(url)
        print("requests headers:", r.request.headers)
        print("status code:", r.status_code)
        
        r = httpx.get(url)
        print("httpx headers: ", r.request.headers)
        print("status code:", r.status_code)
#

should i clear network cache or something? honestly have no idea

cedar forum
#

those won't be caching unless you tell them to

cedar forum
# civic basin how does this have different behaviours ```python import requests ...
requests headers: {'User-Agent': 'python-requests/2.32.4', 'Accept-Encoding': 'gzip, deflate, br, zstd', 'Accept': '*/*', 'Connection': 'keep-alive'}
status code: 200
httpx headers:  Headers({'host': 'pubmed.ncbi.nlm.nih.gov', 'accept': '*/*', 'accept-encoding': 'gzip, deflate, br, zstd', 'connection': 'keep-alive', 'user-agent': 'python-httpx/0.28.1'})
status code: 200
#

loool

civic basin
#

huh

#

its the same version of httpx as well

cedar forum
#

hahahaha

civic basin
#

any other easy to use async http library?

#

i just need to get a bunch of data in one place but its like 400 pages so i dont want to wait everytime

cedar forum
#

hmm i don't think this is down to the library honestly

#

this is weird

#

i'd try it from a vpn or something and see if it's some sort of ip block

#

also the page you are trying to get doesn't actually hvae the 400 pages of content on it

#

oh wait i misread you

civic basin
#

yea i have a bunch of different pages to select though, that was just the first one i saw

cedar forum
#

ignore me

#

yea

civic basin
#

hmm

cedar forum
#

yeahhh i'm not sure

#

just seems weird

hollow gulch
#

lowkey a beatiful function

ebon silo
#

how the hell did I manage to break a docker network lol, I've been debugging this for hours, trying to figure out why my reverse proxy wasn't able to reach one of my services, only to find out that the network is apparently somehow just completely broken, still no idea how this can even happen.

b290e1360eda  ~  ping 10.80.16.2
PING 10.80.16.2 (10.80.16.2) 56(84) bytes of data.
64 bytes from 10.80.16.2: icmp_seq=1 ttl=64 time=0.054 ms
From 10.80.16.4 icmp_seq=3 Redirect Host(New nexthop: 10.80.16.2)
From 10.80.16.4 icmp_seq=2 Destination Host Unreachable
From 10.80.16.4 icmp_seq=5 Redirect Host(New nexthop: 10.80.16.2)
From 10.80.16.4 icmp_seq=6 Redirect Host(New nexthop: 10.80.16.2)
From 10.80.16.4 icmp_seq=7 Redirect Host(New nexthop: 10.80.16.2)
64 bytes from 10.80.16.2: icmp_seq=8 ttl=64 time=0.026 ms
64 bytes from 10.80.16.2: icmp_seq=9 ttl=64 time=0.021 ms
64 bytes from 10.80.16.2: icmp_seq=10 ttl=64 time=0.018 ms
From 10.80.16.4 icmp_seq=11 Redirect Host(New nexthop: 10.80.16.2)
From 10.80.16.4 icmp_seq=13 Redirect Host(New nexthop: 10.80.16.2)
From 10.80.16.4 icmp_seq=16 Redirect Host(New nexthop: 10.80.16.2)
From 10.80.16.4 icmp_seq=22 Redirect Host(New nexthop: 10.80.16.2)
^C
--- 10.80.16.2 ping statistics ---
39 packets transmitted, 4 received, +9 errors, 89.7436% packet loss, time 38890ms
rtt min/avg/max/mdev = 0.018/0.029/0.054/0.014 ms, pipe 3

 b290e1360eda  ~  ping 10.80.16.4
PING 10.80.16.4 (10.80.16.4) 56(84) bytes of data.
64 bytes from 10.80.16.4: icmp_seq=2 ttl=64 time=0.018 ms
64 bytes from 10.80.16.4: icmp_seq=3 ttl=64 time=0.024 ms
From 10.80.16.2 icmp_seq=4 Redirect Host(New nexthop: 10.80.16.4)
64 bytes from 10.80.16.4: icmp_seq=5 ttl=64 time=0.021 ms
64 bytes from 10.80.16.4: icmp_seq=6 ttl=64 time=0.014 ms
From 10.80.16.2 icmp_seq=7 Redirect Host(New nexthop: 10.80.16.4)
From 10.80.16.2 icmp_seq=8 Redirect Host(New nexthop: 10.80.16.4)
64 bytes from 10.80.16.4: icmp_seq=9 ttl=64 time=0.018 ms
64 bytes from 10.80.16.4: icmp_seq=10 ttl=64 time=0.019 ms
64 bytes from 10.80.16.4: icmp_seq=11 ttl=64 time=0.015 ms
64 bytes from 10.80.16.4: icmp_seq=12 ttl=64 time=0.013 ms
From 10.80.16.2 icmp_seq=13 Redirect Host(New nexthop: 10.80.16.4)
From 10.80.16.2 icmp_seq=14 Redirect Host(New nexthop: 10.80.16.4)
64 bytes from 10.80.16.4: icmp_seq=15 ttl=64 time=0.019 ms
^C
--- 10.80.16.4 ping statistics ---
15 packets transmitted, 9 received, +5 errors, 40% packet loss, time 14312ms
rtt min/avg/max/mdev = 0.013/0.017/0.024/0.003 ms

I never even saw ping do redirects, somehow it seems like the two IPs are conflicting, it's an external docker network, I'll probs just recreate it, but if anyone has any idea what the hell did this I wouldn't mind hearing it, weirdest behavior I ever saw, could it be like a mac address conflict or something?

ping on reply please

#

(other IPs on the network are reachable without issues, just the 10.80.16.4 - forgejo and 10.80.16.4 - traefik seem to have some conflicting behavior)