#networks

1 messages · Page 29 of 1

prisma cobalt
#

run the server first

next sapphire
#

ok will do

prisma cobalt
#

also dont run both scripts in IDLE

#

that wont work

#

to make it create 2 seperate processes

next sapphire
#

Ok I have been testing them on my laptop and desktop, but I guess since the client is going through the router it doesnt matter lol, will do give me one second

prisma cobalt
#

you can test on the same computer lmao

next sapphire
#

yeah I just thought of that lol its been a long couple of days ha, both scripts seem to hang, but I also changed "new_socket" to "sock" in the server I think thats what you meant, but yeah no prints

prisma cobalt
#

ou ran the server first?

#

and you changed "publicIPhere" to the actual public ip?

next sapphire
#

yes I did

prisma cobalt
#

i dont know then sorry

#

its weird

next sapphire
#

You are good it seems to be a weird problem, do you know if there is a way to see if a firewall is blocking it by any chance?

prisma cobalt
#

i dont know sorry, you could download wireshark and see exactly what the packets are doing but its a guess

next sapphire
#

that is an interesting idea, I'll look into it, thanks for your help!

solar pumice
#

anyone knowledgeable with Apache Websocket reverse proxy? ( I am trying to get socket IO on a flask application to work but i am failing every time )

clear bobcat
solar pumice
#

hum... i've never done NGINX before

#

I don't really want to switch solutions just for this minor thing. So perhaps if you can just showcase your config file, maybe i'll take it from there

clear bobcat
#

What library are you using to expose Flask application?

solar pumice
#

Liberary?

#

I'm exposing it via Apache reverse proxy, no?

#

but the ws connection keeps on disconnecting

clear bobcat
#

However I am on different computer

#

I will check it later, ok?

solar pumice
#

Sure

velvet lichen
#

i think i fixed my broken pipe error 😄

#

after a day of trying to figure it out

prisma cobalt
#

was it a closed connection like someone said :)

velvet lichen
#

one of my variable was global so every client's thread tried to catch ALL the messages

#

so it crapped out

prisma cobalt
#

lol

velvet lichen
#

now im sad cuz i wasted a day

#

lmao

#

i always get stuck on stupid crep like this.
i once tried to fix some code that didn't work for 3 HOURS,
i later found out that i forgot a : at the end of a while loop and i wasted 3 hours for nothing

#

thats what happens when you dont take time to read tracebacks

fluid fog
#

Hello everybody !
I made this lib : https://github.com/kstzl/UrsinaNetworking
Originally writen to the Ursina Engine but it work for every type or project 😉
Its a "real time, bi directionnal, event based" socket communication
have fun 😉

velvet lichen
#

very nice

fluid fog
#

thank you 🙂

prisma cobalt
velvet lichen
#

i did get but i didnt read it

#

idk y

prisma cobalt
#

🤦

#

thats on you lmao

velvet lichen
#

give me a break i was new

#

at least i now read travebacks

prisma cobalt
#

damn right 😂

velvet lichen
#

does every language do the tracebback thingy or just python?

prisma cobalt
#

your ide should have picked up on it before it ran

#

even IDLE has that feature lmao

velvet lichen
#

lmao nah mate i used nano

#

now i use micro

#

which doesnt have that feature ether

#

afaik

prisma cobalt
#

you use a terminal ide 😂

prisma cobalt
#

but why

velvet lichen
#

idk

#

its easier to access/use and my pc takes ages to load anything. although i do have subline installed, i dont use it much

clear bobcat
# solar pumice Sure

Here is how I run Flask

import ssl
from typing import NoReturn

from flask import Flask
from flup.server.fcgi import WSGIServer

def run(http: Flask, certificate: str, key: str) -> NoReturn:
    ssl_context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
    ssl_context.verify_mode = ssl.CERT_REQUIRED
    ssl_context.load_verify_locations(certificate)
    if certificate == key:
        ssl_context.load_cert_chain(certificate)
    else:
        ssl_context.load_cert_chain(certificate, key)
    http.run(host, port, ssl_context=ssl_context)

Here is a template for Docker NGINX

upstream endpoint{
    server ${ENDPOINT_HOSTNAME}:${ENDPOINT_PORT};
}

server {
    listen      ${NGINX_PORT};
    server_name localhost;

    location / {
        try_files $uri @endpoint;
    }
    location @manager {
        include       fastcgi_params;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        fastcgi_param SCRIPT_NAME "";
        fastcgi_pass  endpoint;
    }
}

server {
    listen      ${SOCKETIO_PORT} ssl;
    server_name localhost;

    ssl_protocols          TLSv1.1 TLSv1.2;
    ssl_certificate        /etc/ssl/certs/ca.pem;
    ssl_certificate_key    /etc/ssl/certs/ca.pem;
    ssl_client_certificate /etc/ssl/certs/ca.pem;
    ssl_verify_client      on;

    location /socket.io/ {
        try_files $uri @endpoint;
    }
    location @manager {
        include       fastcgi_params;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        fastcgi_param SCRIPT_NAME "";
        fastcgi_param SSL_CLIENT_CERT $ssl_client_raw_cert;
        fastcgi_pass  endpoint;
    }
}

You have separation between /socket.io and other pages (you can host on different ports like me). However I am not master of NGINX config and people from #web-development may have better tips pithink

solar pumice
#

Thank you for this

clear bobcat
#

Your welcome!

velvet lichen
#

i forwarded a port and i have no idea to what ip i should bind my socket to.

velvet lichen
#

nnvm.... stack says to put it on 0.0.0.0 or my internal one

clear bobcat
velvet lichen
ember ledge
#

Hey

prisma cobalt
#

which is probably what you want

cinder olive
#

hey, I'm trying to figure out how to connect to the SSH server of a juniper switch and to then hop over to other device/devices. But when I do:

from netmiko import ConnectHandler 
hop_switch = ConnectHandler(
        device_type='juniper',
        host='hallo.com',
        username=username,
        password=password)

hop_switch.send_command('ssh howareyou.com')
output = hop_switch.find_prompt()
print(output)

The thing though, juniper first wants you to accept the key which looks as follows: "Are you sure you want to continue connecting (yes/no)? and then it prompts you with "password:"
The "send_command" doesn't work. Does anyone know how to solve this?

prisma cobalt
#

or generate a key and just use that

cinder olive
#

So I write the password in here "hop_switch.send_command('ssh howareyou.com')"

prisma cobalt
#

no i realise im wrong here, its much better to make a key

#

then you can authenticate with that

cinder olive
#

I don't see how I could generate the key, sadly enough I don't know too much about IKE and so forth

prisma cobalt
#

are you running windows 10 or what?

cinder olive
#

Yes

prisma cobalt
#

i forget the steps after this, better look it up

cinder olive
#

So this key will then, authenticate me through the RADIUS/TACACS+ server? thinkmon

prisma cobalt
#

its just ssh authentication

#

i dont really know about the RADIUS stuff

cinder olive
#

Also if I swap hop_switch.send_command('ssh howareyou.com') to hop_switch.write_channel('ssh howareyou.com') I do get a prompt back asking for "Password:"

prisma cobalt
#

i dont know the difference between send-command and write-channel sorry

cinder olive
#

I've figured it out, partly!

ember ledge
#

I am trying to get a endpoint of a app but when i try to get the request using fiddler i cannot do the thing on the app (changing a name).
(timeout error)

azure rock
#

Hello how can I send a public key , private key and username through a request in python

Like this

curl -u username --key "privatekey.pem" --cert "cert.cer" --cert-type PEM

prisma cobalt
#

lmao

velvet lichen
#

i got a question can i close connection for a specified ip?

prisma cobalt
#

you can close a socket

velvet lichen
#

wait so i can do client.close() ?

prisma cobalt
#

yeah

velvet lichen
#

i just have a lot of clients in a list and i want to be able to close connection for each one... like socket.close("112.123.135.12")

#

@prisma cobalt

prisma cobalt
#

if its sockets then do:

list[index].close()
list.pop(index)
velvet lichen
#

ah. i see. thank you!

plain furnace
#

.topic

lavish oxideBOT
#
**If you could wish for a library involving networking, what would it be?**

Suggest more topics here!

trim moth
#

@prisma cobalt hey remember me? The router less guy? You were gonna walk me through setting up aws to run a python socket server script, I got into some stuff, now I'm free please ping me when online lmao

prisma cobalt
trim moth
#

@prisma cobalt yeah, I'm free the whole time

#

Call me by your convinience

prisma cobalt
trim moth
#

lmao I don't mean VC by call lmao, just ping

prisma cobalt
#

ah right lmao

#

have you made an aws account?

trim moth
#

no lol

#

Lemme do that real quick

#

But I have some things to ask before moving

#

Will I be able to update the running script, like versions

prisma cobalt
#

yeah pretty easily via ssh'ing into the terminal

trim moth
#

Oh okay

#

Sweet

#

Just gimme a couple of minutes, my internet's acting up a bit

prisma cobalt
#

lol ok

trim moth
#

Which one do you think is better/simpler, aws or heroku?

prisma cobalt
#

ive never really used heroku and with my guide i think youll find aws easier

trim moth
#

Ooh

#

I'm kinda (a lot) excited for your guides lmao

prisma cobalt
#

lol i mean, dont get your hopes up to high. i set mine up a few weeks ago

#

but it took ages trying to figure out how ot do it

#

so hopefully i can simply tell you to save some time

trim moth
#

Yeah

prisma cobalt
#

have you made an account?

trim moth
#

Bruh it's asking for banking info

prisma cobalt
#

yeah its annoying and it might charge you a penny or something to confirm but if you get the free tier they dont charge you

trim moth
#

I need to get my dad's debit card lmao

#

But he's sleeping

#

This suks

prisma cobalt
#

Lmao

trim moth
#

Got it

#

yo!

#

account created

prisma cobalt
#

Nice, go to your dashboard

trim moth
#

yeah

prisma cobalt
#

Send a screenshot, lol I forgot the exact layout

trim moth
#

as the root user right?

prisma cobalt
#

Yeah

trim moth
#

this is what i'm seeing

prisma cobalt
#

Launch a virtual machine

trim moth
#

yeah

prisma cobalt
#

Then send a screenshot lmao

trim moth
#

gotcha

prisma cobalt
#

Jesus that’s a lot of tabs

trim moth
trim moth
#

i'm gonna have to wait 24 hours?

prisma cobalt
#

Hmm that didn’t happen for me

#

Try, complete registration

trim moth
#

ye

#

this is what i'm seeing now

#

yo?

prisma cobalt
#

Yes this is good

trim moth
#

lmao

prisma cobalt
#

Go down and select Ubuntu 20.x

trim moth
#

yeah

prisma cobalt
#

It doesn’t matter what x is since there’s only one option with it

#

Then select it

#

Then select free tier

trim moth
#

yeah

#

review and launch?

prisma cobalt
#

Yep

trim moth
#

then launch ig

prisma cobalt
#

Yeah

trim moth
prisma cobalt
#

Make a new pair

#

Download the key

#

That’s your way of connecting to the server

trim moth
#

what do i name it?

#

anything?

prisma cobalt
#

Whatever you want

#

I named it “key”

trim moth
#

lmao

#

ok

#

launch instance?

prisma cobalt
#

Yh

trim moth
#

next?

prisma cobalt
#

View instances

trim moth
#

now we need to get the script running on it right?

prisma cobalt
#

Yeah so you’ve got an instance running now

#

Click on the instance I’d

trim moth
#

yeah

#

okeh

prisma cobalt
#

Okay you want to connect to it so go to connect (top left)

trim moth
#

yeah

#

connect?

#

yo

prisma cobalt
#

No

#

Ssh client

trim moth
#

f

#

i pressed connect

#

now i'm on this terminal

prisma cobalt
#

Send a screenshot

#

You should probably leave the terminal tho

trim moth
prisma cobalt
#

Then go to ssh client

#

Yeah leave

trim moth
#

yeah

#

yeah left the termina;

#

just closed that tab lmao

#

under the ssh tab

prisma cobalt
#

Press the copy sign under bullet point 4

trim moth
#

yeah

prisma cobalt
#

Then go to your file explorer

#

And locate your key

#

That you saved earlier

trim moth
#

yeah

#

got the key

#

what to do now?

prisma cobalt
#

Okay once your in the same directory as the key

#

Click on the search bar in file explorer and type cmd

trim moth
#

okay

#

yeah got a cmd

prisma cobalt
#

Keep the cmd open, put the server.py file into the same directly as the key

trim moth
#

yeah

#

one sec

#

done

prisma cobalt
#

Okay send the line that you copied here

trim moth
prisma cobalt
#

Is that it?

trim moth
#

yeah

prisma cobalt
#

It should begin with ssh

trim moth
#

oh then you must mean the last line

#

this one?

prisma cobalt
#

Yeah

trim moth
#

lmao

prisma cobalt
#

Case sensitive

trim moth
#

threadead_server.py

#

ignore the scuffed name lmao

prisma cobalt
#

Okay this is the command you should paste into the cmd terminal:

trim moth
#

is the colon in the end, a part of the command?

#

lmao its done

prisma cobalt
#

Yeah

#

Sense a screenshot

trim moth
#

of the terminal?

prisma cobalt
#

Yeah

#

To check it worked

trim moth
#

yeah it uploaded the server file

prisma cobalt
#

Good

trim moth
#

sweet

prisma cobalt
#

Okay decide what port you want traffic to connect on

trim moth
#

the same port the server script uses

prisma cobalt
#

Btw what you’ve done is set up a server and transfer the script over to it

#

Which is?

trim moth
#

which is?

prisma cobalt
#

What port

trim moth
#

oh

#

the server script uses the port 5002

prisma cobalt
#

Okay what you need to do now is what I struggled with

#

You need to open that port

trim moth
#

ooh

#

like port forwarding?

prisma cobalt
#

Go back to your instance

#

Yeah

trim moth
#

yess

prisma cobalt
#

Hang on I’m loggin in to show you

trim moth
#

back to the instance

#

yeah, it's night here lmao, i have all the time in the world dw

prisma cobalt
#

security

trim moth
#

yeah

prisma cobalt
#

click there

trim moth
#

yess

#

in it

prisma cobalt
#

tcp or udp?

fickle shuttle
#

output

trim moth
#

tcp

fickle shuttle
#

output

trim moth
#

in it

prisma cobalt
#

delete this message btw

trim moth
#

yess deleted lmao

trim moth
prisma cobalt
#

jeez give me a sec 😂

trim moth
#

yupp

trim moth
#

sorry

prisma cobalt
#

wait

#

dont do it

#

did you do it?

#

if you did no harm done

trim moth
#

yeah i clicked, but it gave me the warning

prisma cobalt
#

have you created the rule?

#

instead of editing the ssh rule i meant to add a new rule, my bad

trim moth
#

lmao

#

i clicked on save rule, but there's some warning there which prevented stuff form happening ig

prisma cobalt
#

nice

#

okay

#

add rule

trim moth
#

ye

prisma cobalt
#

then this

#

then save

trim moth
#

yeah it's already on custom TCP

#

its asking for a ICDR something

prisma cobalt
#

ICDR?

#

show me

trim moth
#

CIDR sorry

prisma cobalt
trim moth
#

oh

#

ok

#

same as above

prisma cobalt
#

exactly

#

once saved it should look like this:

trim moth
#

we good?

prisma cobalt
#

ah you didnt put in the proper port

trim moth
#

f

#

new rule again?

prisma cobalt
#

no edit

trim moth
prisma cobalt
#

yeah save

#

okay difficult bit over

trim moth
#

now we good

prisma cobalt
#

okay click actions then reboot

trim moth
#

reboot what?

prisma cobalt
#

since the changes need to take effect

trim moth
prisma cobalt
trim moth
#

lmao my bad

prisma cobalt
#

okay this is going good

#

all you need to do now is start the server script

trim moth
#

yeah

prisma cobalt
#

remember that ssh command you copied?

trim moth
#

yeah

prisma cobalt
#

paste exactly that into the cmd terminal you created before

trim moth
#

the same command again?

prisma cobalt
#

yeah the ssh..... one

trim moth
#

yeah

prisma cobalt
#

send a screenshot

#

we are nearly done btw

#

also how familiar are you with linux terminal?

trim moth
#

somewhere between noob and intermediate

prisma cobalt
#

have you sshed in?

trim moth
#

connection timed out

#

f

prisma cobalt
#

no thats the command that begins with scp...

#

you need the ssh -i... one

trim moth
#

oh

#

ooh

#

sorry my bad

#

should i copy it again from the instance?

prisma cobalt
#

yeah probably

trim moth
#

yeah ssh'd into it lmao

#

feels like a pro hacker to ssh into something for the first time in my life lmao

#

does python come preinstalled in here?

prisma cobalt
#

yeah which is nice

trim moth
#

so we basically done?

prisma cobalt
#

nearly

trim moth
#

oh

prisma cobalt
#

send a pic of the ssh'd into it

trim moth
#

yeah it har python 3.8.5 lmao

prisma cobalt
#

good, you see that your script is there

trim moth
#

yeah

#

just run it

#

right?

prisma cobalt
#

do python3 threadead_server.py

#

yeah

trim moth
#

sweet

prisma cobalt
#

now you have a server running your script for you

#

try it out

trim moth
#

wanna join on a chat from your terminal?

#

wait a min lemme share the client file

prisma cobalt
#

k

#

also update the ip in the script obv

#

its a static ip as well which is brill

trim moth
#

yeaah

prisma cobalt
#

well at least for as long as the server is up

trim moth
#

in the client file

prisma cobalt
trim moth
#

yeah i was gonna guess that one too lmao

errant bayBOT
trim moth
#

oh

prisma cobalt
#

lol

trim moth
#

bruh i pasted the file content on the pastebin

#

what do i do now?

prisma cobalt
#

send me the link to it

trim moth
#

oh

#

here

#

i'm dealing with this for the first time lmao

prisma cobalt
#

have you started it

trim moth
#

yeah

prisma cobalt
#

no problems connecting btw

#

speak words on it lmao

trim moth
#

lol

prisma cobalt
#

theres a flaw i think

#

yeah there is

trim moth
#

lol

prisma cobalt
#

you can only recieve message when you send a message

trim moth
#

heh?

prisma cobalt
#

i can show you

#

dont send anything

trim moth
#

yeah

prisma cobalt
#

i just sent a message, still dont send anything

trim moth
#

yeah

prisma cobalt
#

im guessing you cant see what i just sent

trim moth
#

yeah, nothing after this is a test

prisma cobalt
#

oh hang on

trim moth
#

lmao

prisma cobalt
#

i just sent something else

trim moth
#

yeah i can see that reply in discord message

prisma cobalt
#

hmm weird

trim moth
#

lmso

prisma cobalt
#

well its good

#

but its not happening for me

trim moth
#

lol

prisma cobalt
#

send something

trim moth
#

yeah

prisma cobalt
#

say when you have

trim moth
#

i just sent something

prisma cobalt
#

okay heres my situation: nothings come up

trim moth
#

whoooo

#

that's weird

prisma cobalt
#

when i send a message back to you, then it prints the message

trim moth
#

i see

#

somethings wrong with the threading stuff

#

lmao

#

the messages sent by me are waiting to be printed out till you send your next message

#

it needs fixing lol

#

but i'm over the moon for this at least worked lmao

#

yo?

prisma cobalt
#

sorry im back

trim moth
#

lmao

prisma cobalt
#

this happened to me once as well

trim moth
#

lol

#

can you send your code?

prisma cobalt
#

i forgot how i fixed it pithink

#

i dont have it

trim moth
#

😭

#

lmao

prisma cobalt
#

lol

#

hang on let me look it up

trim moth
#

yeah

#

or with enough time, i'll be able to fix it lol

#

or neural nine's there for help anyways

prisma cobalt
#

lmao i used him as well

#

in fact i even refer to him in one of the pinned message in this channel

trim moth
#

yeah i saw that lmao

#

the videos are pretty good

#

noicce

#

ah, and how do i update the server file in the future?

#

and how to stop this instance? since it only has like 750 hours per month or something ig

trim moth
#

oooh

prisma cobalt
#

24 hours in a day
max 31 days in a month
24 * 31 = 744

#

744 < 750

trim moth
#

yeah

#

i see

#

so it's basically free for lifetime

#

or for a year?

prisma cobalt
#

i have no idea lmao

trim moth
#

lol

prisma cobalt
#

its annoying

trim moth
#

lol

#

but that's okay

prisma cobalt
#

i would create a batch file to update it

trim moth
#

i don't know how to do that

#

i could make a python script to run the commands for me tho

prisma cobalt
#

hang on ill make you a batch file for it

#

send me the ssh command again

trim moth
#

ye lol

#

both lmao

prisma cobalt
#

okay got it, delete it

trim moth
#

ye

prisma cobalt
#

what was you server script called again

trim moth
#

threadead_server.py

#

lmao

errant bayBOT
#

Hey @prisma cobalt!

It looks like you tried to attach file type(s) that we do not allow (.bat). We currently allow the following file types: .gif, .jpg, .jpeg, .mov, .mp4, .mpg, .png, .mp3, .wav, .ogg, .webm, .webp, .flac, .m4a.

Feel free to ask in #community-meta if you think this is a mistake.

prisma cobalt
#

goddamn

trim moth
#

bruh

prisma cobalt
#

ill dm it to u

trim moth
#

yess

prisma cobalt
#

ahh we did it

#

i walked someone through aws setup with pyhton multithreaded chatroom

trim moth
#

Lmao, you're the man, the myth, legend, EVORAAAGEEE

#

cool name tho

prisma cobalt
#

ah thanks

#

now get some sleep lmao

trim moth
#

Yeah lol

#

Bye

velvet lichen
#

i just finished coding a little socket client on my goddamn iphone 4s running ios 6

#

writing code on the little screen is hell

pearl anchor
#

hey if anyone is on i had a question
i have a linux laptop and a windows 10 computer
if my laptop sshs into my computer and runs a flask server, will my computer be able to develop on that server or will my laptop be limited to the server only
is there a way where i can have my windows 10 server running on a linux laptop and edit my files on my windows 10 computer?

clear bobcat
#

However you should be able to start HTTP server from different machine and still edit files

#

There could be problem with reloading server to apply file changes

pearl anchor
#

i want to edit my files on my windows pc right, but i dont have enough space for my terminal to be open for me to debug

#

i want my terminal on a different browser and i want to utilise ubunut's tmux

clear bobcat
#

On Windows 10 you have virtual desktops or something similar

pearl anchor
#

i wanted to use the windows 10 ubuntu terminal but i couldnt locate my other drive

#

and i dont know how to mount my other hardrives

pearl anchor
#

no

#

the ubuntu terminal that can be downloaded from ms store

clear bobcat
#

It's WSL

pearl anchor
#

is it ?

clear bobcat
pearl anchor
#

oh okay

#

yeah

clear bobcat
#

When you have for example C: drive you can access it by ls /mnt/c/

pearl anchor
#

mnt as it mount?

#

woudl other drives be mounted by default? or do i have to mount them

clear bobcat
pearl anchor
#

i tried ot just do h:

#

but it didnt do anything

clear bobcat
#

You can list all of them by executing command

$ ls /mnt
pearl anchor
#

ahh it worked

#

so cool

#

but i really wanted to ssh into my windows 10 pc

clear bobcat
pearl anchor
#

so if i have a bash wsl running, is that a machine? so in terms that, if my dir is my h drive, i could ssh into my ubuntu bash from my linux mahcine?

clear bobcat
pearl anchor
#

it works

clear bobcat
#

Can you describe what you did?

pearl anchor
#

i setup sshd on my windows pc

#

and then went on my linx pc and just used my username@device_local_ip

#

or lan ip

#

and then it connected to cmd

#

i dont know how its running but its runnig

clear bobcat
#

That's all? No problem with ports? Wow

pearl anchor
#

nope

#

im at home

clear bobcat
#

However sometimes ports are just closed pithink

#

Okay, anyway - good for you!

solemn relic
#

I have written a app with flask, websockets, and zerorpc running ontop of gevent. I would like to swap out zerorpc for something where I can list connected clients, and server can send to client without first receiving a request. Any tips on libraries I can look at? I don't want to use sockets directly as I then have to handle fragmentation etc myself. Using protobuf for serializing. Sorry if this is the wrong channel

warm kite
#

I'm trying to port forward and I need some help. Can someone tell me what External Source IP Address means here? What do I have to fill in? Thanks

warm kite
#

hmm okay, thanks

solemn relic
#

@warm kite what router is this? External source port number might need to be filled as well?

warm kite
solemn relic
warm kite
#

cool, but I don't understand why do I have to fill in 5555 in both my external & internal port number? Whats does external port number imply?

#

internal port number is the port thats on my laptop, right? the one that i'm running my application on? so whats with the external port number?

prisma cobalt
#

if they are the same then the port number simply doesnt change which is usually waht you want

#

an example would be setting port 8080 lets say for ssh'ing which usually uses port 22

#

so 8080 is external which is where people access it and its forwarded to port 22 to ssh

warm kite
#

Oh, got it. Thanks a ton man 🙌 . Also I can leave out the External Source IP Address, I don't need to fill that, right?

reef wigeon
#

Hello. I am trying to build a python online game using sockets and udp protocol.
I created a multiprocessing and multithreading server: https://pastebin.com/ZucxWPC9. I will explain what the code in there does. So first it's waiting for two requests and puts them in lobby list. If two requests have been made, the server sends the clients a new port and creates a new process with two threads. Both threads are using the new port , one receiving and the other one is sending the data. I am using a queue so i can keep track of data and avoid using the same resource in the same time.
The client is a pygame game. I made this small test game of squares moving where the mouse position is. https://pastebin.com/QdKU6Rij. I have a connection class which i put in init of the game. At first i used multithreading for the connection as well but i observed it was running really slow (i dont think it was threads fault now but i really have no idea). So the curent connection class connects with the main server, waits for a port to be send and starts a new process with two threads: one listening for data and one is sending. I used a queue in there as well even though the multiprocess queue is slow. It was just for test purpose.

There is also a file in there for global variables (in case you want to run the code) : https://pastebin.com/RhDwjeKQ

The problem with this code is that it gets laggy until it completly freezes. At first it works really good but after a few seconds the square looks like it teleports. My guess is that there might be a memory leak or something i have completly missused, and not really the problem with sending and receiving because my square is laggy too and when the program freezes there so more printing from the update function either. Everything stops.
If you have any idea why this happens I will be so grateful. I have to finish this project before 30 this month and I am really lost because of this problem. Any advice is really helpful!

ember ledge
#

Anyone here who is familiar with sockets, ssl?

trim moth
trim moth
ember ledge
#

I'm looking for someone who would like to help me a bit with a socket, ssl requests sending code. 🙂

#

I need the code to open a connection between a api, and then sending requests thru it.

reef wigeon
solemn relic
#

Calling sock.sendto as fast as possible might not be the best idea ?

#

Try to implement a fixed update loop. Have it run like 30 times a second.

#

Also, p = multiprocess.Process(target = new_lobby.. are you spawning a new_lobby process every iteration of the loop?

sand perch
#

#Arduino #Elegoo #MEGA2560

This is the Elegoo MEGA 2560 R3 Complete Starter KIT
► Buy: https://www.amazon.it/dp/B01JLTVX6U​

Elegoo MEGA 2560 Starter KIT is for advanced users like professional lab engineers, electronic major students and experienced hobbyists for Arduino projects.
Quantity and quality are both important here in Elegoo MEGA 256...

▶ Play video
reef wigeon
#

@solemn relic thank you for answering. I will try making sock.sendto slower. I am not spawning a new lobby every iteration, only when len(lobby) == 2 (2 clients who sent message. After I start the new process lobby list becomes empty and waits again for two clients)

ember ledge
solemn relic
#

@ember ledge static IP is offered by some ISPs - at least where I live. Often costs extra. One solution could be a dyndns service if you control the computer you are connecting to?

solemn relic
#

He also has some very good articles on other aspects of network programming for games.

reef wigeon
#

@solemn relic I tried making it slower but the game works slower now too. I first made the server slower and it almost stopped the game. I made the client slower and happned the same. I made them both and it was even worse . I used asyncio and waited enough for only 30 packets and when I ran the client code it was terrbile. I ll read what you send

ember ledge
#

Looking into DynDNS but I don't really know what it is.. And of course... I'm only connecting to the computers I can control.

solemn relic
#

I personally use namecheap's DynDns service with a custom domain for some services; like my parents connecting to my VPN server etc, since my current ISP doesn't offer static IPs at all.

ember ledge
#

All right so is my idea crazy?

warm kite
#

@ember ledge I have a dynamic IP too, so I use a dyndns service called NO-IP. It's basic plan (free) allows you to use 3 hostnames per account. It's pretty cool. They just have a 10mb software that gives you a host , it checks ur public ip every 3 minutes or so, and updates the hostname with the public IP. Here:
https://www.noip.com/

ember ledge
#

I don't really understand what these do...

#

The other one mentioned was DynDNS.

warm kite
#

dyndns is just the name of the service. It is actually implemented through the various instruments like NO-IP and name cheap and many more.

#

I'm not a pro on this stuff too, but since I've been using NO-IP for a while now...

molten jay
#

who here has worked with Text_FSM

blissful sand
#

can someone help me with ip configuration? i don't have much experience

arctic kestrel
#

Hey guys

#

I did implemented a UDP video sharing protocol but after some changes it does not work

#

Client side gives segmentation fault error

errant bayBOT
sturdy scarab
#

Hi

#

Anyone here knows how to sync requests?

#

Hey 😦

trim moth
#

lmao I'm probably not the one you're looking for, sorry

arctic kestrel
#

Hello everyone, there is a Segmentation Fault error in this codes but I couldn't find the reason. I tried to use faulthandler, it gave me:

[WARNING] stderr: Exception in thread Thread-2:
[WARNING] stderr: Traceback (most recent call last):
[WARNING] stderr:   File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
[WARNING] stderr:     self.run()
[WARNING] stderr:   File "/usr/lib/python3.7/threading.py", line 870, in run
[WARNING] stderr:     self._target(*self._args, **self._kwargs)
[WARNING] stderr:   File "main.py", line 201, in camera_receiver
[WARNING] stderr:     faulthandler.enable()
[WARNING] stderr: AttributeError: 'LogFile' object has no attribute 'fileno'

Server: https://paste.pythondiscord.com/jorecejexa.py
Client: https://paste.pythondiscord.com/wawuqanema.php (It works in a thread)

EDIT: SOLVED THE ISSUE

Here is the solution: Do NOT trust the "set" function in OpenCV library since it may not set the resolution to what you want! Just I've used a get() function to get dimensions and saw that it is not the dimensions I set before 😦

#

Could you help me please?

ember ledge
#

anyone know how to set up a secondary wifi router with no ethernet cables being connected and for it to be able to still work with the primary router being off?

#

i just wanna use the internet as my dad keeps turning it off when hes done using it which is kinda selfish and even my mum agrees

ember ledge
#

Or could there be a hack for that ?

steep juniper
cerulean marsh
#

I want to make a program that detects when a device connects to my wifi, how would I do so?

steep juniper
#

listen to a broadcast

#

tho that sort of thing is better left to the router

safe agate
#

Does someone know something about OPUS in python?

#

i really cant find anything on the web ...

#

i need it to encode audio recorded with pyaudio

pine pulsar
#

Hello their, i try to connect my flask app with flask_discord but when i'm login it return that :

#

Can you help me?

storm saffron
#

what port is your server listening on

pine pulsar
#

Yes fix it just now lol

#

Thx for help :)

rancid night
ember ledge
#

guys I have a question

#

Around how long of learning does it take until you can get hired by countries as a python expert?

prisma cobalt
storm saffron
rancid night
#

anybody here with websockets experience? Is Autobahn python a good solution for latency-critical audio streaming or would I be better off just using "vanilla" websockets?

ember ledge
#

Hi

Is there a DNS library for python that allows me to grab CNAME records for a domain?
I searched and there wasn't, there is a Toolbox provided by Google that does this stuff but they don't offer any API; is there any free API without rate-limit to grab CNAME records?

humble scroll
#

Hi, so my router has a USB input, and recently I discovered that I can connect my HDDs to it to create a local server in the network, however, it uses SMB1, so is it a good idea to run it?

#

Also, does the connected Device, aka my PC gets those security vulnerabilities by enabling SMB1 in control panel?

lyric dirge
#

hey, i have a question altho i'm not sure if this is the right place to ask

#

but i think it's the closest one

#

so, i was trying, not for illegal porpoises, to connect to an FTP server using proxies

#

but it does not work like requests, i mean, with requests i could have created a proxies variable, giving it the url of my proxy, and then ad the moment of accessing the site i would have written requests.get('site's url', proxies=proxies)

#

but i can't use the argument 'proxies' with FTP

still smelt
#

when i create two UDP sockets in my python server only one of them will recieve packets from a client. How do i have 2 sockets working in the same program?

lyric dirge
#

wow, i just noticed that noone ever answers questions in this channel

prisma cobalt
#

Hey that's not true 😂

#

I try

lyric dirge
#

oh, sorry (,:

prisma cobalt
#

Just because you haven't gotten your answer within the first 10 mins. Although I see your point with the steak of unanswered questions above yours lmao

lyric dirge
#

yeah, i can wait days for my answer

#

also bc i found a way but it doesn't really work that fine

#

i said that bc of the ananswered quests before mine

#

but i was superficial and looked only at like three of them

prisma cobalt
#

I help with sockets but anything other then that is beyond me 😂 sorry

ember ledge
rocky epoch
#

Hi all
does anyone know how to get the open ports within a segment of a LAN
in python?

trim moth
#

Like, pack all of your functioning server code inside a function and launch two different threads running that function so that you'll end up with two servers within one program

cinder schooner
#

can i use same requests session after rerunning program? i want to have same session for like 10 program runs

still smelt
#

@trim moth

#

Thanks

astral moat
#

Can someone help me out whit this?

Basically I was trying to make a server on python with sockets but I can't solve the problem with the Ip as despite I have tried various types or the server or the client does not accept them

astral moat
#

I don't know how

#

I can only paste it

#

import socket

HOST = '255.255.255.255'
PORT = 3000

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.bind((HOST, PORT))
s.listen()
conn, addr = s.accept()
with conn:
print('Connected by', addr)
while True:
data = conn.recv(1024)
if not data:
break
conn.sendall(data)

prisma cobalt
#

Try 0.0.0.0

visual plank
#

||6.9.6.9|| --> it would probably work lol

astral moat
astral moat
#

But it still don't work for the clientlemon_sentimental

storm saffron
#

0.0.0.0 is only for the server

#

On the client you need the server's IP

hallow bear
#

Hey everyone. So I just learned about this server and joined as soon i could. So basically I have a project idea that we con do in groups. Please tell me if anybody is interested. I can't do it alone. It also needs a feature that two distance people should be able to connect. Can anyone here help me?

#

wel will work together

distant basalt
#

someone said to be a good cybersecurity expert, you must understand networking to the highest degree

trim moth
zinc aurora
#

hi

pine ivy
#

hi

#

how are you?

peak zealot
#

hi

#

I am new

#

to this serever

#

What's up?

clear bobcat
sick wadi
#

Hi Guys I want send Json Data to target Ip how can i do it?

clear bobcat
sick wadi
#

Sample: 89.163.142.192:30120/players.json

#

How can I send data here

#

manual

#

@clear bobcat Any Information?

clear bobcat
#

!pypi requests

errant bayBOT
sick wadi
bronze parcel
#

Best way to set up a nas that i have to pull data from?

#

Im a beginner, so if im wrong about something just say so

trim moth
#

Tell me more, maybe I can help you figure out some stuff

bronze parcel
#

Nvm, i got it figured out

still smelt
#

is it bad pracrice to have a server with multiple udp sockets for each client on different threads?

#

i feel there is a better way to do it

stoic elm
zenith wadi
#

What's up, everyone? New to this sever but glad to be here. Frankly am not at all good @ coding/programming (took a class and cheated my way thru it), and am much more sales/marketing based.

Looking to connect/network with any software devs for a project idea of mine. Would love to chat, Also, I am assuming this channel refers to "networking" as in connecting w/ people. If I am wrong and networking is a coding term, apologies. Cheers 🤙

trim moth
trim moth
# stoic elm If anyone knows anything about flask and/or web sockets, kindly take a look at t...

if it's possible to keep track of the IP's of the connected users, just make it so that, if any user is currently editing the form, no other user from any other IP address can edit it simultaneously. there can be one and only one user at a time. just don't accept any other connections while someone's connected. and about the timeout, use the time or datetime module to keep track of time elapsed since the one particular user is editing, if it's 2 hours, send him somewhere else

stoic elm
stoic elm
trim moth
#

lmao i have no idea of anything about vue js lol

errant blaze
#

And you need to use flask IO socket

#

@stoic elm Do you want something like google docs that even a change of a letter updates the docs or when the user clicks "update" update the interface?

stoic elm
#

Preferably I want sth like Google docs, but is it easy?

errant blaze
#

You would use to need websockets

#

and use Vue to handle every change in the docs

#

and then send the information changed via web sockets

#

or display the new information if received

#

any new data

#

I mean, is not hard but takes some work

#

If you want a easier path

#

Just update the data

#

when users click in the "update" button

#

then you can use SSE(Server Sent Event) to update the data

stoic elm
#

Yeah sounds hard for me haha

#

Thank you! Will look into that option as well

errant blaze
#

Is not hard to implement

#

take a look at this example

#

you just would need to use Redis thoe

#

I didnt find any flask package that handles sse without it

bronze ivy
#

hy guys can you help me?
I'm developing a reverse shell, but for allow that to communicate in wan, i need port forwarding...
I tried with openport+ open vpn.. But it worked only yesterday afternoon..
Can u help me?

errant blaze
#

Is the port closed again ?

#

What is happening ?

bronze ivy
#

i dont using the port forwarding directly on the router..

#

i'm using openvpn for configuration and openvpn as a "host"

errant blaze
#

Is your computer firewall

#

Allowing the connection ?

bronze ivy
#

i activated the DMZ on router, and, disable the firewall on pc (server part)

dry lotus
#

what ipv6?

bronze ivy
#

ipv4

#

TCP

dry lotus
#

isn't ipv4 your local ip address?

torn dust
#

Hello, what's a good free API to use when I just need to send some data online to access it again from a another service? (using python)

weary silo
#

if hardware blocks the ports there isnt much you can do about it lol

bronze ivy
#

alright guys, all working perfectly

ocean nova
neon wing
#

I'm currently using my work laptop for my studies, however there are limitation as to what I can install due to admin right which is expected. I have always used Windows PC/laptops, I do have a desktop PC but now thinking of going for a laptop that I can use personally with the benefit of portability.

I'm studying for my CCNP, and will need to run GNS3/VMware/VirtualBox, I know that Virtual box gave me issues on the Windows laptop with Intel Processor so then started to use VMWare which resolved the issue.

I'm now thinking of purchasing a Mac Book Air/Pro, though not decided which one as of yet, but can someone advise if I go for the Mac Book Air with the M1 chip, will that support virtualization, ie VMWare/Virtual box. Furthermore, I'm now learning programming also (Python), from what I read some features of Python are built into MAC, but on Windows you need to install subsystem in order to run Python.

Thanks in Advance

slender steeple
#

@neon wing python works perfectly fine on windwos

#

and im pretty sure mac's python is outdated

#

though this question is off topic for this channel

weary silo
#

both windows and mac have 3.9.4

#

if you want m1 youre probably restricted in software and im not sure if vmware/virtualbox works on m1

#

i know parallel exists

#

you'd have to check for software compat. yourself

slender steeple
#

edit: mac's default python

trim moth
glad kestrel
#

How do I get starting in networking for python?

clear bobcat
glad kestrel
# clear bobcat What do you want to do? Create own client/server application? Work with raw inte...

ultimately my goal create my own SD-wan in kuberneties at an ISP level WISP, with public wifi networks at a large scale with a mix architecture of arm64(RPI) and x64 in mind. This also includes AI as a governor for autonomous learning and governance. I dont know where to start. its an idea i have been playing with for some time now.
It will handle customer data at some point, directly or with a api handshake.

glad kestrel
prisma cobalt
clear bobcat
glad kestrel
clear bobcat
glad kestrel
glad kestrel
# clear bobcat New term for me

if you want to know more.
https://g.co/kgs/kjiRYg
SD-WAN is an acronym for software-defined networking in a wide area network. SD-WAN simplifies the management and operation of a WAN by decoupling the networking hardware from its control mechanism. Wikipedia

glad kestrel
clear bobcat
glad kestrel
#

so with the format to code in an ideal of SD-WAN it is my idea to make my own software to have to then use for myself and then maybe later lease out to 3rd parties. @clear bobcat

clear bobcat
glad kestrel
#

Ideally if I can stay within python as the majority coding path. This is to do with simplify the number of total amount of tools and staying in the py ecosystem.

The maintenance crew for the code is going to end up being cheaper.
I dont what my code to break long term.
As i heard JavaScript code tends to break more as of lately with its high velocity development going on with it.

I heard rust and python combo can work together for better speed(best of both worlds)

So yes as a prototype because I want to get this idea in a tangles state to then show investor that what I am doing is possible.

clear bobcat
glad kestrel
#

But if I can keep most of the code in python/rust/pthyon AI code combo that would be great.

clear bobcat
#

It can be good choice to make some parts of your code in fast technology

glad kestrel
glad kestrel
clear bobcat
clear bobcat
glad kestrel
glad kestrel
clear bobcat
clear bobcat
#

Rust had some problems with newest features pithink

glad kestrel
clear bobcat
glad kestrel
glad kestrel
gloomy root
#

You just have the advantage of not having to immediately worry about how you're handling pointers and allocation

#

but doesnt stop other people miss handling unsafe in crates fingergunz

clear bobcat
clear bobcat
glad kestrel
glad kestrel
gloomy root
clear bobcat
gloomy root
#

If it was a year ago chances are it's moved along way since then

#

there have been some fairly major architecture changes for LLVM and Rust in the last year and most importantly bug fixes 😅

rocky epoch
#

Hi all

#

I need some help with my code

#

the code is not working with class but the code is working fine without class

glad kestrel
# glad kestrel My issue is I am trying to make an ecosystem with my product line. one thing I a...

One of the reason I need arm is because of its low power for low power bills in 2nd and 3rd country electric rates.
even in a cluster its still comparably low power compared to a hardware nuc cluster. although nucs are better for performance individually as well as a cluster of them, My vending machines are ruling on hybrid solar power kits. so lots of complexity in this puzzle to get internet to persons in 2nd and 3rd world countries (for the last mile of internet)
exhale thats a mouthful to say....

PS nucs using 64bit architecture CPU's would simplify deployment but again I am on electric power constrains.

SO I see rules as something I can use to keep the speed up and the power bill low, but then again, have AI requires python.... which I need more Hardware spec power.
Im feeling stuck here in trying to plan this out.

clear bobcat
clear bobcat
ember ledge
#

anyone here tried to transition from ip networking to devops?

glad kestrel
clear bobcat
glad kestrel
glad kestrel
clear bobcat
#

And remember about Intel Curie history where companies spent a lot of money to learn their employees how to work with those devices and Intel just stopped production

clear bobcat
# glad kestrel WHAT? GOT article link?

https://community.intel.com/t5/Intel-Makers/Intel-Curie-End-of-Life-Scheduled/m-p/397070#M22117

However it looks offtopic here so we can move to one of the offtopic channels

glad kestrel
#

What I am talking about has never been done, nor there is no such code that is available. I crawled through the internet so I know this business model does not exist.

clear bobcat
glad kestrel
#

yes!

clear bobcat
#

Good luck then!

glad kestrel
#

Please come help me .. i have the idea but I dont know how to code...

clear bobcat
glad kestrel
glad kestrel
glad kestrel
ember ledge
#

is there any RUDP library for python?

fossil juniper
#

Anyone here know anything about securecrt I am trying to automate configurations with my network with it and I don't have access to my routers and switches when I'm not at work is there a way to troubleshoot with crt on a virtual cisco router/switch?

queen lake
#

Hi I needed help with deploying a socket script on heroku

#

when i use a debugger, I get to know that my client connects to the server but is unable to send/recieve data

#

but on the logs it does not show that I connected

wide path
#

I have a similar system in real life and the connection is via wifi how would I allow only 1 packet lose and keep the system working after said package lose, using UDP

#

is there no way to ensure that a single packet can get lost without affecting the functionality of the system ?

steep juniper
#

if you need all packages to go through:
assign a unique key to each package
send the package again if no confirmations comes back
on the receiving side dont progress a package with a key from a package that has been processed already but send a confirmation regardless

glad kestrel
ember ledge
#

no schizophrenia pills

#

you're delusional, but I'm sure you've been told this many times, so I was just joking

glad kestrel
ember ledge
glad kestrel
# ember ledge you're delusional, but I'm sure you've been told this many times, so I was just ...

Well sleep deprived, and looking for meaning, purpose and love, with a place I can feel welcome to call, "home", amongst others is what I seek.
I create to make the work a better place so that I can achive my personal goals.

If you have honesty to speak to me they way you feel and/or think then I am listening. But don't gaslight me nor put your disbelief of my deeds (towards me)on me in a format such as passive aggression.

This is the internet, there is alot of things that happened, some strangers to us yet they are closer to our hearts because of the shared passion and camaraderie.

So speak your mind, heart, soul, emotions to me fully. don't be passive-aggressive to me or gaslight me.

My claim to fame as I placed into this channel is not the only one I have. but I have kept mostly quiet about what I have done in my past, I seek a better tomorrow for me, as well as for all.
Edit: this does not make me mentally-ill because of my claim.
We are strangers you and I.
So it is difficult to explain my life in the short few moments we have first made contact today.

trim moth
#

Sorry to break it to you, but this is the networking channel in the official python discord server lmao

prisma cobalt
#

@glad kestrel whats your idea?

glad kestrel
# prisma cobalt <@!755336903888470066> whats your idea?

Kuberneties and docker, but I gave it away the idea and let it become opensource.
I just asked to be remembered and have my name on my work as I passed the idea in collaboration to others. But sigh.. I ave been forgotten about...

glad kestrel
glad kestrel
# glad kestrel Well I help create what is easily billions of GDP in the tech industry, and para...

People called me a dreamer back then, and unrealistic back then when I when I was trying to dream up and explain what docker and kuberneties was...
Some made me feel crazy by their scorn and/or scoffing aimed at me.
Letters on a screen, a mask of a computer that we can hide behind.
But I made it, I got my idea out there to change the world.
Now I see I can change the world again with another Idea.

open gull
#

Does a json post request to an api is encrypted when it over https?

glad kestrel
gloomy root
#

might wanna just remind yall this is #networks not who made Docker and K8s

open gull
gloomy root
#

not really, read the links i sent

open gull
#

okkk

trim moth
prisma cobalt
prisma cobalt
weary silo
#

i mean...

#

docker werent the first one to containerize software...

#

and the creator/inventor/founder of docker and k8s has probably something better to do than rant in a discord for python beginners

storm bison
#

Ok so I worked on a project where I used a company's FTP credentials to get their inventory file. Makes sense it's one credential and all their customers use the same credentials on FTP to get the same inventory file.

#

So from here my understanding is that a company has a FTP server and if they give their clients and customers the credentials they can get the files.

#

I emailed another company if I can get their api to access data.
But the representative of the company said, they need our FTP server.

ember ledge
#
from aiohttp import TCPConnector

host = '194.106.175.218'
port = '8080'

connector = TCPConnector(local_addr=(host, port))```

im trying to build a connector here with a https proxy but im getting an error
#
OSError: [Errno 10049] error while attempting to bind on address ('194.106.175.218', 8080): the requested address is not valid in its context```
storm bison
#

So my question is, if we create our own ftp server and give the credentials to them they can upload their inventory files to it?

Wouldnt it be too much work for them to have to keep adding credentials for all their clients and upload inventory for all of them?

smoky belfry
#

can i use a network to communicate between 2 languages?

prisma cobalt
#

im 100% sure that i might be correct

neon kiln
#

hi

#

guys why this return one thing and stop !

#

How I can return without stop .

echo remnant
echo remnant
bitter agate
#

does any one has chat in django?

#

blog or app like whatsapp

#

with socket module

prisma cobalt
knotty wyvern
knotty wyvern
# neon kiln

why would it return more than one thing? You only call the function once

#

maybe you want to wrap it in a while loop?

prisma cobalt
smoky belfry
#

perfect! thanks

ember ledge
#

Any tips for making a socket all the time alive, so 18 requests can go thru? - After 2 it stops responsing with a status code.

ember ledge
#

Yes.

#
i = 0

data = []
context = ssl.create_default_context()

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect(('api.minecraftservices.com', 443))
    with context.wrap_socket(s, server_hostname='api.minecraftservices.com') as ss:
        while i < 6:
            for bearer in BEARERS:
                ss.send(b'POST /minecraft/profile HTTP/1.1\r\nAccept: application/json\r\nAuthorization: Bearer ' + bytes(bearer, 'utf-8') + b'\r\nHost: api.minecraftservices.com\r\n\r\n{"profileName": "' + bytes(target, 'utf-8') + b'"}')
                data += [ss.recv(10000).decode("utf-8")]
            i += 1
ember ledge
clear bobcat
#

Have you tried to see what is going on with tools like WireShark?

ember ledge
#

I'm pretty new to socket, so there might be some things i wont understand 😬

ember ledge
#

But not sure if i know how to tho..

clear bobcat
#

WireShark is a tool which allows to see network flow (packet by packet), maybe connection was reset or something pithink

ember ledge
#

Is there any toturial for that?

#

Or is it just, something i gotta search up for?

clear bobcat
#

Download it and pick some free help channel, we will see what is going on

ember ledge
#

Alright, will do!

supple oak
#
import  socket, time
sock = socket.socket(socket.AF_INET , socket.SOCK_STREAM)
ip = socket.gethostbyname("www.marca.com")

sock.connect ((ip, 80))
while True:
    sock.sendall(b"GET / HTTP/1.1\nHost: www.marca.com\n\n")
    bufsize = 50
    output = " "
    buf = sock.recv (bufsize)
    while (buf):
        output  += buf.decode("utf-8")
        buf = sock.recv(bufsize)

    print(output)
    print("------------------------")
    time.sleep(1)

while testing out this snippet of code, i wanted to make the request-response repeat itself every second but it gets stuck on the second iteration onwards

#

then i get a brokenpipeerror

tall basin
#

I'm trying to connect my computer to my esp8266 which uses microPython

here's the server code(laptop)

import socket

mes  = 'hello there!'

s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.bind((socket.gethostname(), 3333))
s.listen(5)
while 1:
    clientSocket, address    = s.accept()
    print(f'You are connected to {address}')
    clientSocket.send(bytes(mes, 'utf-8'))

here's the microPython code(esp8266)

s = socket.socket()
host = '192.168.29.157'
port = 3333
addr = socket.getaddrinfo(host, port)[0][-1]
s.connect(addr)

the code fails at the last line with this error
OSError: [Errno 104] ECONNRESET

NOTE:
the code given here works fine-https://docs.micropython.org/en/latest/esp8266/tutorial/network_tcp.html
and the server also works fine

supple oak
neon kiln
neon kiln
neon kiln
#

why ??

prisma cobalt
#

the whole point of a generator is that it returns values as it calculates them

sterile loom
#

@gloomy root did you open sourced how to automate the RSS feed parse in your Crunchy bot?
I am confused while looking at the source codes.

gloomy root
#

errrrrrrrrrrrrrrrrrrrrrr maybe?

#

Idk if i finished the new system for it or not

#

ah i didnt

#

well the TL'DR it just uses a task which waits every n seconds in a while loop and uses FeedParser

sterile loom
#

You mean @task.loop ?

gloomy root
#

the equivalent of that yeah

#

the webhook system itself is done on a seperate web server

sterile loom
#

?

gloomy root
sterile loom
#

Ok...I will try but I don't think I can make it
I am a dumb coder :grin:

gloomy root
sterile loom
#

Thanks

#

Ah... Isn't the latter one also incomplete?

glad steppe
#

Anyone here a heavy networkd user with IPv6? Anyone contributed to it before?

gloomy root
hollow yarrow
#
else:
    ip_address = input("Enter the ip address and range that you want to scan(ex: 192.168.1.1/24): ")
    print("______________________________________________________")
    print(" IP\t\t MAC Address\t\t MAC Vendor")
    print("------------------------------------------------------")
    scan_result = scan(ip_address)
    result(scan_result)
#
Enter the ip address and range that you want to scan(ex: 192.168.1.1/24): 192.168.29.1/24
Traceback (most recent call last):
  File "s.py", line 35, in <module>
    ip_address = input("Enter the ip address and range that you want to scan(ex: 192.168.1.1/24): ")
  File "<string>", line 1
    192.168.29.1/24
             ^
SyntaxError: invalid syntax




#

can someone find wht this error means

ember ledge
#

In Python 2.7 the input method instantly does eval(), hence the syntax error

hollow yarrow
#

Python 3

ember ledge
#

Strange, I tried debugging your code

#

Once I got the syntax error

#

then not

hollow yarrow
#

Ya...

#

Idk how

#

But now suddenly it worked now

ember ledge
#

sending the thread

glad steppe
#

Always use ipaddress.ip_address() to validate and store IPs.

>>> from ipaddress import ip_address
>>> ip = ip_address("6.9.6.9")
>>> ip
IPv4Address('6.9.6.9')
hollow yarrow
glad steppe
#

Just a ranomd IP address

#

To show as an example

#

*random

ember ledge
#

In any case, this is a great approach regarding the storage 👍

glad steppe
#

Ya, just use the .compressed method when you need a str

#

Or .exploded or .explod (can't remember name)

#

These are the same for IPv4 but standard ways to represent IPv6

dawn sand
#

hello

#

can i make a multiplayert game with python

#

is this possible

#

with pygame also

#

if so

#

how?

prisma cobalt
prisma cobalt
dawn sand
#

TY

hollow rivet
#

hii anyone use virtual box?

#

anyone have any idea plz share how to connect net in virtual box

last ore
#

Actually I need some virtual machine to use from inside ubuntu

#

I wonder which one to choose the best

#

Gnome Boxes looks best ubuntu choice

shy island
#

is there a way to create chat room accessible world wide

#

using a password

#

because every tutorial i see of sockets is on the same pc

#

😔

ember ledge
#

Hi guys,
Can anyone share some link or advise on the doubt im having
Suppose two ASBRs learn about two different network pre-fix how will the interior routers with in the AS running IGP learn how to send traffic to the correct ASBR for thier respective prefix

prisma cobalt
#

You know that altho the tutorials use the same pc, if you simply change the IP to an external pc you can connect to it

prisma cobalt
shy island
#

🤔

prisma cobalt
prisma cobalt
#

Again you might have to put forward

shy island
#

is there a tutorial for it

prisma cobalt
#

Port forwarding?

shy island
#

yes