#networks

1 messages · Page 28 of 1

prisma cobalt
#

but your right, you shouldnt host a server.py script from a phone

hardy salmon
#

somebody who want's to help me with some coding

prisma cobalt
junior jungle
#

hey i need help how do i send packets to a ip address

#

if someone can help me dm me please

prisma cobalt
#

You gotta give more info

pine ivy
#

Hi guys i need help

#

Can any wanna help me

#

?

#

I am building chat application with python, sockets

#

And at one point have syntax error

#

I couldn't find that error

#

class ServerNode:
    def __init__(self):
        LISTENING_PORT = 12000
        
        try:
            socket_instance = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            socket_instance.bind((str(socket.gethostbyname(str(socket.gethostname)), LISTENING_PORT))
            socket_instance.listen(4) #error is at this point (line 10)
            print('Server running!')
            
            while True:


                socket_connection, address = socket_instance.accept()

                connections.append(socket_connection)


                threading.Thread(target=handle_user_connection, args=[socket_connection, address]).start()

        except Exception as e:
            print(f'An error has occurred when instancing socket: {e}')
        finally:
            if len(connections) > 0:
                for conn in connections:
                    remove_connection(conn)

            socket_instance.close()
#

File "c:\Users\Lenovo\Desktop\Server\server.py", line 10
socket_instance.listen(4)
^
SyntaxError: invalid syntax

storm saffron
#

mismatched brackets

#

from the line before

prisma cobalt
fickle wharf
#

hey guys, I'm new to python and was wondering where to get practice

#

I'm taking this course at my university but I'm also looking for some other resources

junior jungle
prisma cobalt
#

tell me more info

junior jungle
prisma cobalt
#

hmm have you ever heard of rule 5?

ember ledge
#

I found it kinda wierd but necessary at the same time that thats a rule due to there being the possibility it being purely for legal reason

light zealot
velvet lichen
#

should i be worried about security when i forward ports?

still pulsar
#

hello

mild gate
#

Greetings

#

I am new here

harsh trail
#

hi

#

i have a question about selenium

#
from selenium import webdriver
import time
from datas import rows, names,links
from selenium.webdriver.common.keys import Keys

driver_path = "/usr/local/bin/chromedriver"
browser = webdriver.Chrome(executable_path=driver_path)
browser.get("https://stockx.com/")
test1=browser.find_element_by_xpath("//button[@class='chakra-button css-6bzlzp']")
time.sleep(2)
test1.click()
time.sleep(2)
a=browser.find_elements_by_xpath("//input[@class='searchbox input-text form-control']")
a[0].send_keys(names[0])
time.sleep(5)
a[0].send_keys(Keys.ENTER)
time.sleep(2)
b="%s"%links[0]
url=browser.current_url
select = browser.find_element_by_class_name('css-1mweixr-Button').click()
time.sleep(2)
browser.execute_script("window.open('');")
browser.switch_to.window(browser.window_handles[1])
browser.get(b)
time.sleep(3)
#

that is my code

#

and i get an error

#

selenium.common.exceptions.ElementNotVisibleException: Message: element not visible

#

it is that

#

what should i do

#

it should click the dropdown menu button

#

select = browser.find_element_by_class_name('css-1mweixr-Button').click()

#

but it doesn't

#

the html code is that

queen obsidian
#

so i am trying to pull a file off an ftp server using ftplib but that server is in a folder outside the folder that the code is executing in so instead of moving that file to the folder the code is executing i want to make the code move to the directory that has my file in it so any help?

#

here is my code

from pathlib import Path
serv = FTP('server')
file_path = Path('my_file')
serv.login()
with serv as ftp, open(file_path, 'rb') as file:
    ftp.storbinary(f'STOR {file_path.name}', file)```
#

wait

#

...

#

ok for the people who lost braincells from this i am sorry i thought that the storbinary method was downloading files not uploading them

#

so the error it gave me was because it didnt find the file i was trying to get

#

i am so sorry lol

#

imma leave this for comedy

queen obsidian
#

ok i am not uploading an actual file but it gives me this error Traceback (most recent call last): File "C:\Users\Mansi\PycharmProjects\FTPython\CoreFile.py", line 12, in <module> serv.storbinary(f"STOR {filename}", file) File "C:\Users\Mansi\AppData\Local\Programs\Python\Python39\lib\ftplib.py", line 491, in storbinary with self.transfercmd(cmd, rest) as conn: File "C:\Users\Mansi\AppData\Local\Programs\Python\Python39\lib\ftplib.py", line 386, in transfercmd return self.ntransfercmd(cmd, rest)[0] File "C:\Users\Mansi\AppData\Local\Programs\Python\Python39\lib\ftplib.py", line 352, in ntransfercmd resp = self.sendcmd(cmd) File "C:\Users\Mansi\AppData\Local\Programs\Python\Python39\lib\ftplib.py", line 279, in sendcmd return self.getresp() File "C:\Users\Mansi\AppData\Local\Programs\Python\Python39\lib\ftplib.py", line 252, in getresp raise error_perm(resp) ftplib.error_perm: 550 No such device now i dont know what to do about this so yeah

ornate grail
#

i just completed making a simple game where 2 ppl try to spam w and up arrow and each tap moves their character forward a tad and it goes unti any person reaches the finish line and I'm wondering how would i go about making this online. I've heard of using the socket or twisted framework but i dont know where to go from there. I should mention I did this in pygame

coarse root
#

Hi! I have just started python and I wanted to try sockets. However, I am getting this error: " [WinError 10060] A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond" How do I fix it?

meager plinth
#

Hi guys
I am new to Python and I have to use Netmiko Library to ssh and control network device. :v Before this, I use cisco packet tracer to work with virtual device, cli to code. When I run netmiko base on what I see in youtube, I just receive nothing :v Do I have to use packet tracer together or have real device ? Any useful link or document for this project will be good for me :(( Thanks

trim moth
ember ledge
#

hi

prisma cobalt
jaunty ice
prisma cobalt
#

if your connecting to an external network you probably havent port forwarded anyway

trim moth
#

I need help in understanding how to build a IRC client in python with which one can do basic stuff like join/create a channel, send and receive messages/files, etc.

#

Like, what libraries to use, how to go around building it

prisma cobalt
trim moth
#

Nah, I haven't started anything yet

#

But I have some experience with sockets

#

Built a server and client to exchange messages

#

Made a server and a client to transfer files from one system to other

#

That's all I have done with sockets so far

#

I am interested in IRC to create a terminal chatting application, I tried it with sockets, but sockets required devices to be on the same local network to connect to each other

prisma cobalt
trim moth
#

Yeah

#

Lemme check it out

trim moth
prisma cobalt
#

have you heard of port forwarding?

#

because on an ordinary network, its required for devices from the outside to connect to a specific device on the inside

trim moth
#

But I have a sim card lol how do port forward on that?

prisma cobalt
#

your... using a phone?

trim moth
#

No

#

My internet for my pc is my phone's hotspot

#

I don't have a router

prisma cobalt
#

oh

trim moth
#

Sed lyf

prisma cobalt
#

that makes things almost impossible to do since your connection changes ip really frequently using data

trim moth
#

But I would get one soon

trim moth
prisma cobalt
#

does it start with 192...?

trim moth
#

Yeah, it's a local ip

prisma cobalt
#

its a local ip

#

exactly

trim moth
#

Yeah

prisma cobalt
#

but to connect from other networks you need your public ip which, with a phone, is impossible to use since it changes

trim moth
#

So I need a global ip from a router with the desired port forwarded and then run the socket server

#

Am I right?

prisma cobalt
#

yeah pretty much

trim moth
#

What's other than the pretty much part which is left?

prisma cobalt
#

nothing much, its just the port forwarding is usually something people need help with the first few times and its a "public" ip not global

trim moth
#

Oh, got it

#

Public ip

prisma cobalt
#

you also need a client script obviously

#

ya

trim moth
#

Yeah I have a client script

#

Then is it possible for a friend from 700 kms. away connect to a server running on my pc with the appropriate client file and chat with me?

prisma cobalt
#

yep

#

just like how instagram and discord work

trim moth
#

Yeah

#

Super cool

prisma cobalt
#

lol, once you get your router and need some help, ping me

trim moth
#

Sure

#

I look forward to that real soon

prisma cobalt
#

when do you think your getting one?

trim moth
#

My birthday is coming in may

#

So ig there's a chance for it then

#

Isn't it really weird for a parent that their son is asking for a router on his birthday?

#

lol

prisma cobalt
#

yeah lmao

trim moth
#

Thank you so much, I really appreciate your help, I don't have any confusion now

prisma cobalt
#

no problem, just message me if u need more help in the future

trim moth
#

Gotcha

#

Hey, I got another idea, what if the server file is running on a web server?

#

Can even then anyone connect to the server?

prisma cobalt
#

what sorry?

#

your hosting a webpage?

#

and yes they can with GET/POST requests

trim moth
#

No, I'm not interested in web pages

#

Like having a linode server, and SSH into it, then run the server file on that server

prisma cobalt
#

youve lost me lmao

#

you can ssh to a machine and run the script

trim moth
#

Uh

#

Bruh

trim moth
#

Not really machine, but a linode server or something

prisma cobalt
#

if its running an os that supports ssh then yeah i gues

trim moth
#

And are there some free services for that? lol

prisma cobalt
#

for sshing or server os's?

trim moth
#

for sshing

prisma cobalt
ember ledge
#
import socket
from datetime import datetime

now = datetime.now()

current_time = now.strftime("%H:%M:%S")
print("Current Time =", current_time)

server_port = 21060
client_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
input_s = 'Hello, server!'
client_socket.sendto(bytes(input_s, encoding='utf8'), ('127.0.0.1', server_port))
input_s_modified, address = client_socket.recvfrom(65535)
print ('[CLIENT] Response from server {}, is: "{}"'.format(address, str(input_s_modified.decode('utf8'))))
client_socket.close()
#

can some one help

#

i would like to make it so the time from the moment the message is sent to the moment the server's response arrives

#

but idc how

prisma cobalt
ember ledge
prisma cobalt
#

What do u mean?

ember ledge
#

and i really dont know how

prisma cobalt
#

Use the time module

ember ledge
#

well

#

ok and then ?

prisma cobalt
#

So do
Start = time.time()
Before message sent
Then do
Print(time.time() - start)
After message received

ember ledge
#

XD let me figure this out

ember ledge
# prisma cobalt So do Start = time.time() Before message sent Then do Print(time.time() - start...
import socket
import time
server_port = 21060
client_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
input_s = 'Hello, server!'
client_socket.sendto(f"{int(time.time())}"(bytes(input_s, encoding='utf8'), ('127.0.0.1', server_port))
input_s_modified, address = client_socket.recvfrom(65535)
print ('[CLIENT] Response from server {}, is: "{}"'.format(address, str(input_s_modified.decode('utf8'))))
client_socket.close()
``` can i dou like this also
prisma cobalt
#

Your sending the time?

ember ledge
ember ledge
tepid creek
#

is it possible to use sockets with proxies ?

true wharf
#

A socks five proxy is just a socket that allows for relaying connections

#

You should look into the protocol

ember ledge
#

any ideas?

ember ledge
#

hi

faint bolt
#

Is there a socket for HTTP for example: socket = socket.socket(socket.AF_INET, socket."HTTP")

shy pebble
#

HTTP is a protocol that operates on top of a socket. There is no http socket since a socket doesn't care whether you are passing http or smtp over it

shy pebble
#

socket.SOCK_STREAM as the second argument

lone haven
#

hello!

#

can I ask for some help in this channel?

faint bolt
#

Like?

lone haven
#

so I have a little python code that is getting requests from a server, and do you know how can I print specific value from the json response?

faint bolt
# lone haven so I have a little python code that is getting requests from a server, and do yo...

Sadly I could not find a solution for that, but there is a post on Stack Overflow that you maybe can use: https://stackoverflow.com/questions/17860937/print-specific-value-from-json-object-with-js

faint bolt
shy pebble
#

what is the error message?

faint bolt
#

OSError: [WinError 10057] A request to send or receive data is not allowed because the socket is not connected and because (while sending on a datagram socket via a sendto call) no address was specified

shy pebble
#

what address do you bind to?

faint bolt
#

My IP

faint bolt
shy pebble
#

and what port?

faint bolt
#

80

shy pebble
#

what line raises that error?

faint bolt
storm saffron
#

what

ember ledge
#

Okay, so I've tried going headless in my pi zero.
I've tried both Debian lite recommended on the pi website and Dietpi.
I've added wpa_supplicant.conf and ssh as per instructions.
I've tried accessing through SSH. nothing.
I've even tried it on my original pi that I have laying around. nothing.
I've noticed that when I plug in my pi, my device manager doesnt show a new COM plugged in.

prisma cobalt
#

k

#

first, reinstall pi os lite on your sim card

ember ledge
#

will do

prisma cobalt
#

i know its a pain but youve gone through first boot which prevents me from helping

#

so we need a fresh install

#

dont plug it into the raspberry pi yet

#

are you using the pi os imager?

ember ledge
#

no i'm using etcher

prisma cobalt
#

hmm, should still work

#

say when your done flashing it

#

i recently went through this process with a pi zero w to run my discord bot lmao

ember ledge
#

that's exactly why i'm doing it

#

done btw

prisma cobalt
ember ledge
#

py

prisma cobalt
#

ah okay

#

i used js but no matter

#

okay

#

your on windows right?

ember ledge
#

bottom right

#

positive

prisma cobalt
#

replug the flash card in (simply pull it out and put it in again)

#

then send a picture of your file explorer like you just did

ember ledge
prisma cobalt
#

a partition called "boot" should have appeared

#

yep okay

#

double click into that

#

then create an ssh file with no file extension

#

the last bit is important

#

do you know how?

ember ledge
prisma cobalt
#

yes okay, now create a wpa_supplicant.conf file and paste this into it:

#

oh btw what country are you in?

#

this affects the contents of the wpa_supplicant.conf file

ember ledge
#

the country of Texas.

#

US.

prisma cobalt
#

paste this:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=US

network={
 ssid="<Name of your wireless LAN>"
 psk="<Password for your wireless LAN>"
}

obviously you need to change the ssid and psk to match your network

ember ledge
#

I don't need the key manager?

prisma cobalt
#

no

#

wait

#

hmm i didnt and it worked lol

#

i guess not

#

damn all these websites say different things

#

i would get mine but thats a pain

ember ledge
#

well it deletes as soon as you boot it up because it gets written straight into some folder in /ect/

prisma cobalt
#

yep i got it, the thing i put above is all you need

ember ledge
#

anyways done

prisma cobalt
#

okay eject the card from your pc

ember ledge
#

okay.

prisma cobalt
#

right click on the storage media widget and eject

ember ledge
#

yup

prisma cobalt
#

did you enter the correct name and password?

ember ledge
#

yes

prisma cobalt
#

lol i messed that up a few times

#

okay plug it into your raspberry pi but dont conenct power just yet

#

do you know the ip of your pi?

ember ledge
#

nope

prisma cobalt
#

okay that makes it slightly harder

ember ledge
#

I can't find it on my network either

#

and it doesn't show up using com ports

prisma cobalt
#

that happened to me too, what i did was install "fing" on my phone which detected it

ember ledge
#

i'll do that.

prisma cobalt
#

the app has a blue icon with a white circle thiny in it made up of dots and lines

ember ledge
#

got it. now what

prisma cobalt
ember ledge
#

yup

prisma cobalt
#

okay turn on the power of your raspberry pi

#

and open fing (make sure your on the same network as your pi as on your phone)

#

and do a network scan

#

Scan for devices

#

You should see an entry like this:

#

(mines offline at the mo so its greyed out)

ember ledge
#

nothing

prisma cobalt
#

theres a light on your pi... is it flashing or stable?

ember ledge
#

the power is finicky if I touch it but right now it's stable

prisma cobalt
#

finicky power?

ember ledge
#

like the wire

#

is finicky

#

I can redo the process with my other pi

prisma cobalt
#

as long as the light is solid green then it should be okay, it weird its not connecting to your network

#

do you have a mini hdmi to hdmi cable

#

for moniter output?

ember ledge
#

not on me no

prisma cobalt
#

fair enough

#

sometimes it takes a while to connect, try another network scan now

#

(the bootup time is suprisingly long for such a small os)

ember ledge
#

nothing

prisma cobalt
#

hang on, in your wpa_supp... file, did you surround the ssid and psk with double quotes?

ember ledge
#

yes

prisma cobalt
coarse moth
#

Making request to yahoo website, after some point I get this error: {code: "internal-error", description: "offset and size is over threshold"} code: "internal-error" description: "offset and size is over threshold" result: null

prisma cobalt
#

okay just checking

prisma cobalt
ember ledge
#

i know ;-;

prisma cobalt
#

hmm i wonder what could be wrong, im not gonna suggest going through the steps again but... if your network manager and fing say its not connecting then it probably didnt get past the connection stage

#

and thats decided on the wpa_sup... file and ssh file

ember ledge
#

it might be my firewall maybe?

prisma cobalt
#

hmm, i didnt have to do anything particular to the firewall to get mine to connect

#

its just another device joining the network

#

is yours a pi zero w or just pi zero?

#

and if its a zero w then how far have you placed it from your router? @ember ledge

prisma cobalt
#

so its a zero w?

ember ledge
#

the computer i'm talking to you right now is on the same network

#

yes

prisma cobalt
#

damn thats the last issue i can think of

ember ledge
#

sigh

prisma cobalt
#

sorry, i have no idea why its not connecting then 😢

ember ledge
#

thanks for trying. I appreciate it.

prisma cobalt
#

my only suggestion now would be to get a mini hdmi cable and plug it into a moniter to see whats happening (you dont need a keyboard or mouse)

#

and even then that might not give any results

#

it might just say "not connecting" or something

ember ledge
#

yeah I might have to. if that doesn't work then i'll just have to buy another pi zero

prisma cobalt
#

i mean they are only about £9 so that could be a valid option ]

#

it would be a pain to get a new one only to have the same thing happen tho

lone haven
#

Hello! So I made a script that send requests, and I need to send the request with a custom header. and I want that custom header to be chosen by the user before sending it, something like : headers={ "token": response }.
It's basically a question response system.

ember ledge
#

I need help

#

With my router.

#

can't reset it

#

no button or whole to use a toothpick and press it.

#

hole*

#

literally nothing.

#

you do not need visual aid to understand.

#

tried using admin command prompt to reset it

#

my router doesn't support telnet

#

AKMIJOUHYBJSA KMASPOI()JSm.

#

nope.

#

the power cable?

#

mmm, I've done that before.

#

didn't reset the router settings

#

I forgot my username and pass for my router so..

#

and you can reset it to restore those 2 things to it's default

#

so..

#

I have no idea that's the thing, I've tried the default and it didn't work so I'm trying to reset it

#

there is no reset button

#

nor a hole with a button

#

f, alright.

queen obsidian
#

does someone here have experience with ftplib i have a problem that i need help with

still pulsar
#

hi

still pulsar
#

i have some questions

prisma cobalt
trim gulch
#

Hi there - has anyone found a good library for picking out RSS feed URLs from a given post address? Ideally one that works for Medium blogs as well

pliant knoll
#

guys how much a servers too rent

ember ledge
pliant knoll
#

aws?

ember ledge
#

i dnt know what kind of server you need

pliant knoll
#

for a messaging app

#

what would you reccomend?

ember ledge
#

it depends on what msg app are you making,
every cloud is nice for its scalability

#

you can start with free tier and use a simple unix machine with public addres
and you can scale it to make it as big as you want

pliant knoll
#

just a bog standard group chat for my family sort of thing

ember ledge
#

then why to pay for server, use free tier on aws

#

should be sufficient

pliant knoll
#

ok

#

what are the bounds of it tho cusi dont want my mum to scream at me why have a been charged something

ember ledge
#

ec2 intance you have it free for 750 hours every month
so you dont have to worry about it
i dont know how this app of yours will be working

pliant knoll
#

i can show you the code

#

if you want

ember ledge
#

and there is no way to set upper limit in amazon of how much do you want to pay

pliant knoll
#

also is there a maximum data thing on the free server

ember ledge
#

but you can set notification that if you will reach overr set value you will get email that $$ is reached

pliant knoll
#

ok

#

is there a cap on data

ember ledge
#

ec2 is a compute server

#

and s3 is simple storage server

pliant knoll
#

is that on the free server

ember ledge
#

5gb is free

#

its about s3

#

i will log in to aws and check ec2 size

pliant knoll
#

it says 12 months free??

ember ledge
pliant knoll
#

after 1 year are you charged??

ember ledge
#

ow yeah forgot not everything is always free

#

gimme a sec i wil check

pliant knoll
#

ok

ember ledge
#

yeah ec2 is only free for 12 month, then you will have to make another account on aws or transition to another cloud

pliant knoll
#

how do you cancel it after 1 year

ember ledge
#

just delete your server in aws

pliant knoll
#

how would i do that tho

#

on the aws acc

ember ledge
#

hmhmhm it will be easier if you take some aws tutorials

pliant knoll
#

ok

ember ledge
#

you have to get at least basic information

#

how to make ec2
how to delete ec2
how to set security zones
and what availability zone to chose from

#

ec2 is 8gb

#

i dont know what ports will uuse your app

pliant knoll
#

thanks

ember ledge
prisma cobalt
#

the amazon servers are a good choice for free hosting?

pliant knoll
#

@ember ledge technically can you use a wifi router as a server for it as it has an IP and a PORT

ember ledge
prisma cobalt
#

you said earlier there was a 750 hour limit or something?

#

so i cant run a low resource script permanently for free?

ember ledge
pliant knoll
#

so you could use a wifi router as a server?

ember ledge
prisma cobalt
#

if i have a server.py script then, which port should i use to recieve data since i wouldnt know if it conflicted with other scripts on their data centre?

ember ledge
pliant knoll
#

its some BT one

ember ledge
ember ledge
prisma cobalt
#

ahh vps majic

#

i think...

pliant knoll
#

IP = ????

#

PORT = ????

#

@prisma cobalt

prisma cobalt
#

huh?

ember ledge
#

aws manages public ip's so there cant be a confict

pliant knoll
#

in your python code

#

put ip and port to connect to that server

#

IP =

#

PORT =

prisma cobalt
#

no i know how to make a chat script, i was just wondering if every user of the amazon servers have a different ip

ember ledge
#

look aws gave me this addres

prisma cobalt
#

ahhh

pliant knoll
#

can we use it??

prisma cobalt
#

then you can use any (>1024) port?

pliant knoll
#

can i use that public IP

#

for my app?

prisma cobalt
pliant knoll
#

why?

prisma cobalt
#

because its not yours 😂

#

you dont have access to the server script running on that ip

pliant knoll
#

i c

ember ledge
#

i think that only those are restricted

prisma cobalt
#

@ember ledge do you know if those amazon ip's they give you are static?

#

since i have a domain name and that would be brill

pliant knoll
#

is that your server @ember ledge

ember ledge
#

and in my work i did saw some undesirable traffic from port 53 and 123 from aws ec2...

pliant knoll
#

is that your server in the pic you sent?

ember ledge
#

you should use dns

prisma cobalt
#

i have a domin name but i have to enter the target ip in the hosting website and if it changes then its pointless

ember ledge
ember ledge
prisma cobalt
#

i have no idea how to work that 😂

#

i have a domain name (ofc i need to point that address to an ip) but your saying i cant use the amazon public ipv4 address they give since they change pretty often

ember ledge
#

if its running 12 months

#

with no breaks thatn you will have same ip xd

prisma cobalt
#

but theres a 750 hour limit?

ember ledge
#

yeah

prisma cobalt
#

your saying i can run it for 12 months?

ember ledge
#

in a month1

#

1 month 750 hours

#

xd

#

12 months x 750 xd

prisma cobalt
#

so every month id get another ip?

#

i feel like im being stupid here

ember ledge
#

checking

#

you get every month 750 hours of instance

#

and if you have more than 1 istance

#

then totally you will use faster those 750 hourrs

#

bc 2 instances in a month use 24 hours a day x number of days

#

so if u have 1 instance of ec2

#

u use 24 h and in march x 31 days = 744 hours

#

so its freee

#

and april comes in

#

and you have new 750 hours in aprill to spend xd

prisma cobalt
#

so will the instance never shut down?

#

therefore the ip will never change

ember ledge
#

until you shut it down, never

prisma cobalt
#

ahhh

#

thank you

ember ledge
#

as seen in the screeen from google xd

prisma cobalt
#

now i need to sign up for aws lmao

ember ledge
#

still you should use some aws tutorials and think about using dns of aws >>> i dont know the price tho ;c

prisma cobalt
#

what do you mean?

#

never mind

#

ill look into it

#

thanks again

neat mango
#

Hey guys

#

Im taking a networking course at university and just got stumped by a question on my exam. Would someone be able to help me?

bold bramble
#

hey need some help with threading (more specifically, PID), could anyone help me?

trim moth
#

@neat mango can you ask the question, coz how're we supposed to answer if there's no question

ember ledge
#

hey, any ideas what kind of sockets are there in iproyal pawns, honeygain, packetstream and etc

#

share internet without proxy forwarding

#

p2p?

#

upnp?

pearl prism
#

What's the best way to create a supervisor service for an API
Currently we are runnning a cron job which does a health_check call for the API and if it doesn't respond restarts
This cron job is scheduled every 1minute
Is there any better way to create a supervisor service?

prisma cobalt
lone haven
#

Is it possible to make a program that watches a specific request of a server every 30 mins to set the header content to a var in the python code?

modern edge
lone haven
#

specific request

lone haven
modern edge
#

so you want to make a program which sends a request to a server every 30 minutes and store the header content of the response sent back by the server in a variable right?

lone haven
#

yup exactly

#

what I wanna do

#

I'm not very good at programming so if you can help me a little bit that can help me a lot @modern edge

modern edge
lone haven
#

yeah I already use it

#

if i have any problems can I ask you in discord dms?

modern edge
modern edge
lone haven
#

yeah probably

#

There's a list of everything I need : Found a way to load a page with python, find a way to get request header of that page and the other thing should be easy

velvet lichen
#

I asked that question before but no one answered, so ill ask again.
Is it secure to forward a port for my python application?
I have no idea how to write secure code (i would love to know how tho)
and i don't want a skid somewhere to get in my router and mess up my computer 'n' stuff.

prisma cobalt
velvet lichen
#

depends on what? on my code?

ember ledge
#

hi

modern edge
shy island
#

Hm

gray sage
#

I needed a module, which is like the net module of js, for IPC connections. Anyone knows?

obtuse stratus
#

idk

velvet lichen
modern edge
velvet lichen
#

thanks you.

weary silo
#

if you just NAT your port then no its not secure at all

#

since you expose it to the internet

#

you should add something like a geoip filter and a reverse proxy

#

that should make it better

velvet lichen
#

I didn't understand 99.9% of what you said... I'm not good at networking as you can see. Still learning tho

weary silo
#

you have a public ip and a local on

#

you NAT your public one to your local one so the traffic gets redirected

velvet lichen
#

ok

weary silo
#

by doing your service is visible to the whole internet

#

and vulnerable

#

thats why you add something like a country/region filter

velvet lichen
#

oh.

weary silo
#

so only specific regions have access to the service

#

you also should put a reverse proxy infront of your service

velvet lichen
#

do i do that in the code or router takes care of that?

weary silo
#

since it adds a layer of security

#

firewall/router is for NAT

velvet lichen
#

oh.

weary silo
#

reverse proxy is just a program/service itself

#

like haproxy

#

or nginx

velvet lichen
#

lmfao i have no idea what those are too

weary silo
velvet lichen
#

anyway. ill add a geo filter or whatever you call it. i need to look into that

weary silo
#

yeah geoip filter

velvet lichen
#

maaaaaaaaaaaaaaaaaaaaaaan. i cant do networking for crep.

weary silo
#

eh its not that hard

#

you just have to learn/do it

velvet lichen
#

alright. btw whats the worst that could happen if i get hacked? i don't have anything interesting in this pc soooo..........

#

@weary silo

weary silo
#

you should look into hosting

#

and just host your app on aws/heroku/azure etc

#

they have free tiers

#

its just not secure doing that

velvet lichen
#

so they have servers that i can host crep on for free?

weary silo
#

aws has a free tier yeah

velvet lichen
#

it allows outbound connections and stuff?

weary silo
#

yea

velvet lichen
#

noice. ill look into it.

#

oof. im just trying to host a site that says "Pingas" lmao

weary silo
#

why

#

just do it locally if you wanna test it

#

why would u want to expose it online then

velvet lichen
#

idk for lols

#

ill maybe do chat apps later...

#

i just want to mess around with the port forwarding stuff so i wont get stuck when i do something larger then a site that says "pingas"

velvet lichen
#

alright thanks.

prisma cobalt
#

@modern edge are you still trying to port forward?

modern edge
#

i wanted to do it earlier

#

a year ago

weary silo
#

lol

prisma cobalt
modern edge
#

i did but just for my reference.

prisma cobalt
#

So your not still interested?

modern edge
#

no

#

well i am

#

but not in building it right now

prisma cobalt
#

Ah ok

#

@velvet lichen are you still trying to port forward?

velvet lichen
#

yeah. just trying to figure it out

prisma cobalt
#

Whose your ISP?

velvet lichen
#

oof i live in israel so you wont recognize them

#

but they are called bezeq

#

what weird names we have for companies here in israel

prisma cobalt
#

lmao, it hsould be same tho if you want some help?

velvet lichen
#

yeah. its all the same NAT and LAN and LDKSJDKJSDNLKGJ

#

all the networking crep is there

prisma cobalt
#

lol, do you know how to open the router config menu from a web browser?

velvet lichen
#

yeah

prisma cobalt
#

then port forwarding should appear somewhere?

velvet lichen
#

yeah. im not stuck on how to port forward. im worried that i get hacked and my data stolen and then agent 20000 come kill me

prisma cobalt
#

oh right lmao

velvet lichen
#

whats the worst that could happen really?

prisma cobalt
#

Unless your script behind the port does system commands then nothing bad really

velvet lichen
#

oh. well no system commands. and that is for sure lol

prisma cobalt
#

What r u planning on making?

velvet lichen
#

i want to get into sockets, websites, and networking in general

#

as you can see i have a loooooooooong way

prisma cobalt
#

Lol

velvet lichen
#

i cant do networking for crep

prisma cobalt
#

The sockets arnt that hard, it's the websites and stuff that's difficult for me

#

There's chatroom code in the channel pins

velvet lichen
#

i haven't tried socket for real stuff

#

by that i mean multi client stuff

prisma cobalt
#

There's a multi user chat code in pins

#

Good place to start

velvet lichen
#

alright.

static prawn
#

Hello everyone, I have an ethernet port on my wall. I plugged the ethernet cable from the wall to my device and it is detected, but the wall ethernet is not responding. Does anybody know why?

ember ledge
#

Yes?

faint hemlock
#

ghost ping

ember ledge
#

Do you have anything to report to the moderation team?

static prawn
#

yes I do, @modern edge DMed me and is being bullshi* to me. He asked me for my address and said he will come to murder me.

static prawn
#

pls ban

#

him

#

/her

ember ledge
#

You should DM ModMail for anything that doesn't require immediate action from us within the server.

static prawn
#

ok

faint hemlock
static prawn
#

ok

#

thx

static prawn
#

bro get ban

#

@modern edge

modern edge
#

i am just trying to help people out here

faint hemlock
#

Please refrain from discussing this on the server

static prawn
#

k

faint hemlock
#

we can't litigate what may or may not have been said over DMs, as we're only moderators for this server.

velvet lichen
#

what's happening?

prisma cobalt
#

Then how does duck mail moderate it?

faint hemlock
velvet lichen
#

yeah ok

static prawn
#

I sent dm to duckmail

#

and report

faint hemlock
#

That's fine. Please resume discussing networking.

static prawn
#

ok

#

Hello everyone, I have an ethernet port on my wall. I plugged the ethernet cable from the wall to my device and it is detected, but the wall ethernet is not responding. Does anybody know why?

velvet lichen
#

networks networks networks networks

weary silo
static prawn
#

how do I know?

weary silo
#

Check your router?

static prawn
#

@faint hemlock sorry to ping, I did a screen recording of @modern edge writing shi* in my DM

#

it is in modmail

faint hemlock
#

!warn 692822662820397167 Please stop discussing this dispute in public channels. We've already instructed you to use ModMail. Telling a moderator in a public channel to read ModMail is not necessary.

errant bayBOT
#

:incoming_envelope: :ok_hand: applied warning to @static prawn.

modern edge
toxic blaze
#

Gotcha

static prawn
#

bruh

weary silo
static prawn
#

How am I supposed to know?

weary silo
#

Check and follow the cable?

#

If it goes onto the wall and if that would reach the room with the wall plug

static prawn
#

no I connect the google router's ethernet cable to the modem

#

and the powerplug to the power outlet

weary silo
#

Yeah but you need a ethernet cable that goes from the router to the wall plug

#

how else would the wall plug be connected then?

static prawn
#

bruh

#

ok

weary silo
#

the wall socket needs a connection to your router

#

be it thru patch panels or switches

#

if there is no connection its not gonna work

limpid kelp
#

Consider an estimated population of 602million people.(a)What is the maximum number of IP addresses that can be assigned per person usingIPv4addressing?(b)Design an appropriate CIDR to deliver a host IP addressfor each person of this population(602 million people).

#

i found a solution to this but i dont really understand

weary silo
#

solution is ipv6

#

ipv4 is a 32 bit address

limpid kelp
#

so for a, i did 2^23 / 602 mil

weary silo
#

why

limpid kelp
#

and got 7.1

#

idk

#

cause binary?

weary silo
#

you can just do 2^32

#

and substract 602 million

limpid kelp
#

and per person

weary silo
#

and then you have all the ips that are left over

#

oh nvm i missunderstood the task

limpid kelp
#

i was wondering if you guys know where i can get help with networking homework if i cant get it here

nocturne glacier
#

What module should I use to work with websockets?

clear bobcat
reef wigeon
#

Hello! I am trying to make a multiplayer game in python. This is my first project so i know verry little and i need more advices. I want people to join different lobbies. I thought about using udp mulicast. I also wanted to use multithreading or multiprocessing. (So it can be cleaner, a process for every lobby) But i'm really stuck. I don t know how to make a multicast address visible across network nor how to handle the lobbies.

coarse moth
#

can i ask question about async requests in this channel?

keen slate
kind furnace
reef wigeon
#

python

kind furnace
# reef wigeon python

are you able to the the standard asyncio event loop or a separate game loop on the main thread?

kind furnace
reef wigeon
reef wigeon
#

could you join a call? maybe it would be easier to explain

errant bayBOT
ember ledge
kind furnace
#

@reef wigeon i cannot join a call, i think before looking at multi-processing you will want to first start with a single running instance of a lobby with clients connected. websockets could be an attractive option, since the connection is duplexed( i.e server can send on same connection that client connects on). https://github.com/codemation/easyrpc - can make setting this up pretty easy, but also allow for frequent client -> server -> client communication.

GitHub

An easy to use rpc framework for enabling fast inter-process, inter-container, or inter-host communication - codemation/easyrpc

reef wigeon
#

@kind furnace I tried making the server and managed to connect clients to it. For every process there were 2 clients connecting and talking to that process. But I think it will be easier if i would use that. Thank you so much!

trim moth
#

Is your lobby on local host?

ember ledge
#

what can i use to connect remotely to a windows machine not on my network?

trim moth
#

lol I've spent days on this thing, we can connect to any machine in the world, by running python socket servers and clients on appropriate machines

#

But

#

The thing is, the port of the host machine that your client is connecting to, must be forwarded on the host

#

If you manage that, you can connect to any machine to create things like TCP chat, a reverse shell on the host, and much more I might not even know of

true ocean
#

pyenet is not receiving anything but sockets are when i tried

queen lake
#

hi can anyone suggest me a good online resource to learn about networking

#

I am confused that if we run a server on localhost what will be its IP ?
would other devices on the network be able to connect to it ?

ember ledge
#

udemy courses

#

coursera courses

#

edx

#

skill share

queen lake
#

ok tysm

ember ledge
#

np

austere horizon
queen lake
#

Thanks alot

austere horizon
#
#

no problem

trim moth
queen lake
#

ok

#

would other devices on the same Network be able to connect to it ?

trim moth
#

Yeah, absolutely

#

I suggest working a bit with sockets to learn more about networking

#

One sec

queen lake
queen lake
trim moth
#

This

#

Is

#

Gewd

#

@queen lake

queen lake
#

Gewd ?

trim moth
trim moth
queen lake
#

ok lol

queen lake
trim moth
queen lake
#

oh

#

now i get it

trim moth
#

Yeah

queen lake
#

the which we get when typing IP config (192.168.xxx.yyy) is the IP which wifi gave us and other devices (on the same network) can use to connect to us

while 127.0.0.1 is our computer's internal network

trim moth
#

Lemme put that in a single statement,
The pc not connected to the internet, the IP in that instance is the localhost (127.0.0.1)

When the pc connected to a network, the pc has two IPs the public ip and the private ip (192.168.xxx.yyy) and the

trim moth
queen lake
#

lol

#

😄 thanks man i understood alot

trim moth
#

Yeah, check out that gewd article and you'll possess the superpower to transferr files from one pc to another

queen lake
#

sure

trim moth
#

And DM me if you ever need anything

queen lake
#

sure

#

just sent a friend request 😉

static seal
#

Could anyone tell me what can happen to a thread if its not locked?

trim moth
#

No idea

latent socket
#

Can i make a realtime chat application with some big features

#

with python sockets ?

#

I am new to python networking side

lone kettle
#

yep

#

use Flask and socket IO

ember cypress
#

absolutely. If it is your first project I would start with adding the smallest thing then moving on to bigger things.

#

Sockets are fun and when you get something that works you are going to blow your own mind.

latent socket
#

no no guys

#

i dont want to use flask or socket io

#

i am asking about default socket module

lone kettle
#

then?

latent socket
#

what is the problem there

lone kettle
#

i've no idea about that

#

sorry

latent socket
#

wait what is special in flask

#

and socket io

#

?

#

@lone kettle are you sure you can make a .exe using flask and socket io

lone kettle
#

you can use Pyinstaller for that

#

that will convert py project to executable

latent socket
#

no

#

you didnt understood by .exe

#

i mean a gui chat application

#

with some big features

#

like discord

#

with ui

#

@lone kettle

lone kettle
#

i guess flask has UI

mighty helm
#

.

#

.

#

hi

latent socket
#

i want application

orchid anchor
#

or should i just do the free version

reef wigeon
storm saffron
#

and in general employers will be much more interested in projects you've done than online certificates

#

so probably don't pay for it

trim moth
#

I'm asking because I have a TCP chat room written ready, but it only works for devices on the same network, and to make it public, I need to get the host machine connected to network router with the considered port forwarded so that anyone in the world can connect to the server, and I had a lot of pain figuring this out lmao. Can't make it public, I need a router which I don't have

reef wigeon
# trim moth How do you plan to do that?

I don't really know either but I have a friend who knows so I will ask him to help me after I finish. There should be many tutorials online and I will rely on that. If you don't hurry up with your project I will help you too after he teaches me how.

trim moth
#

Look forward to learning from you

#

And I tried tutorials too lmao, one of them that seemed to work said to rent a linode server but I don't intend to invest even a bit for this (well I do plan on getting a router, but it's something I'll need anyways).

next sapphire
#

I am trying to get a socket connection over the internet, I made a client.py and server.py scripts and they worked locally, I then switched the ip on the client side to my public ip and then set up port forwarding to my pc (which has a static ip), but the connection is still not happening, and using https://www.yougetsignal.com/tools/open-ports/ , I see that the port isn't even open, any ideas?

#

server.py

import time, socket, sys
 
new_socket = socket.socket()
 
port = 8080
 
new_socket.bind(("0.0.0.0", port))
print("Binding successful!")
 
name = input('Enter Username: ')
 
new_socket.listen(1) 

conn, add = new_socket.accept()

print("Received connection from ", add[0])
print('Connection Established. Connected From: ',add[0])

client.py

import time, socket, sys
 
socket_server = socket.socket()
server_host = socket.gethostname()
ip = socket.gethostbyname(server_host)
sport = 8080
 
server_host = "publicIPaddress"

name = input('Enter Username: ')

socket_server.connect((server_host, sport))
storm saffron
#

how did you set up port forwarding

next sapphire
#

@storm saffron I have it setup through my router like this -

velvet lichen
#

encrypted tcp session is possible?

trim moth
#

@next sapphire 8080 isn't a reserved or a important port right?

#

Like usually ports above 10k are suggested for such stuff

#

The most commonly used example is assigning port 8080 for a web server. To get traffic to this web server, you would need to append the port number to the end of the domain name like http://websitename.com:8080. Note that using port 8080 is not reserved for secondary web servers.

#

Copied from google lmao

#

Try forwarding some other port higher than 10k

meager nebula
#

Anyone able to help me with an issue I have with google cloud? I've been trying to fix it since yesterday, no success

shut compass
#

HI I have a problem with a yesterday script does not go and I do not know why, you can help me?

errant bayBOT
shut compass
pearl topaz
#

hi, i wanna to know how can i check a certain mac address is online within the same lan?

rancid geyser
next sapphire
#

@ Caffeine (don’t want to ping) will do thanks!

twin cape
#

what does modem do

trim moth
next sapphire
trim moth
#

lol

muted frigate
#

Struggling to get ubuntu server online. Is this right channel to ask for help? :)

short abyss
#

that should be web development

#

what is it tho

muted frigate
#

thanks for asking! couldn't get my ubuntu 18.04 server to connect to internet. couldn't make it work, now reinstalled ubuntu 20.04...

short abyss
#

did u check any firewall restrictions

#

also what stack are you suing

#

*using

#

that way I can help you out a little better

prisma cobalt
#

If yes then there’s a trick to it that you have to do first

muted frigate
# short abyss that way I can help you out a little better

Thank you! I had ubuntu 18.04 which worked fine before. But after moving to new physical location, connecting to another router i couldn't get ping to work. Tried all the stack overflow solutions including firewall but gave up an reinstalled 20.04. was due for an upgrade anyway :). Now works fine. Still don't know what was the issue with 18.04...

muted frigate
ember ledge
#

hi, I am using aiohttp and the websockets client, but I have no idea how to call a definitions for an event, could someone explain to me?

next sapphire
#

@trim moth I finally got a chance to try it out, tried port 10080 but no luck, could I be using the wrong public ip or missing something I need to do with my router? I am just using the ip address google tells me I have

#

antivirus wasnt the issue either

trim moth
#

This is wierd

pearl topaz
trim moth
#

Did you get your public ip from Google or your router admin page?

clear bobcat
velvet lichen
#

I'm coding a multi-client TCP chat and a BrokenPipeError messes with me... I have no idea why, but it happens at random... I heard this error can be ignored but, i have no idea how to ignore it... When it happens, the server code is not receiving any message.
having a try-except block is not helpful ether because the error pops up
everytime after the first time, unless the client reconnects.

any ideas why this happens?

clear bobcat
velvet lichen
#

the thing is, its not closed...

clear bobcat
#

Which library are you using?

velvet lichen
#

and if its closed, its not meant to be. that the prob

#

socket

pearl topaz
clear bobcat
clear bobcat
#

I had this problem when GIL blocks the thread

velvet lichen
#

what do you mean GIL blocks threads? i have only two of them.

#

more clients that join, more threads

clear bobcat
clear bobcat
velvet lichen
#

Theres no threads on client code.

clear bobcat
velvet lichen
#

hmmmmmm..... i can maybe add a try-except block that automatically disconnects the client and reconncets him. but, the server doesn't want to recieve the message where the error happens.
what i mean is, when the error is formed its quiet. when the client (me) sends the second message, it dies. its veeeeeeeeeeery weird.
i have 0 idea of whats happening cuz im new to python socket

#

btw @clear bobcat im running the two clients and the server on the same computer. can it cause problems?

velvet lichen
#

crep

clear bobcat
velvet lichen
#

i have no idea what's that.

#

i would like to know tho

clear bobcat
# velvet lichen i have no idea what's that.

When you open TCP connection it dies after some time when there are no packets on line. Despite of packet messages you should keep your connection by sending packets from clients to server which literally means "don't close the connection, I am still here"

velvet lichen
#

ah. so its life support lol

#

anyway, how do i do that? maybe it can solve my problem

clear bobcat
velvet lichen
#

i didn't know tcp just closes itself like that.

#

oof i should save some time to read the docks 😄

clear bobcat
velvet lichen
#

alright.

clear bobcat
#

It's why I prefer to use higher lever libraries which deals with this problems under the hood

#

You can use socket.io to create chat application

velvet lichen
#

i really liked low level stuff cuz you get more control. but a combination of low level stuff and a beginner = crappy thing that doesnt work

#

i mean, my thing works but for 30 secs or less lmao

velvet lichen
#

i later wanna learn C or C# (if C is big brain only) cuz being able to control low level stuff is just cool. but i also might break something

#

i heard you can mess up ur pc if you tamper with low level stuff too much

prisma cobalt
#

guess not

prisma cobalt
prisma cobalt
#

also yeah you probably need to port forward

#

there should be a guide on port forwarding on here

#

ill make one

#

since so many beginners always ask how

weary silo
#

just need to go in your routers settings thru the webinterface and add it if they support it

prisma cobalt
#

yeah but saying that doesnt help the majority of cases since they dont know how to do that

#

im making a guide now

weary silo
#

also you should probably look into aws free tier and other stuff since you mostly have a dynamic ip anyway

prisma cobalt
#

fair point

weary silo
#
  • they would need a bit more setup than just post forwarding
prisma cobalt
#

?

weary silo
#

think ud have to adjust firewall settings

#

exposing that publicly isnt really secure

prisma cobalt
#

i didnt have to, it depends on the router i think

weary silo
#

no

prisma cobalt
#

oh?

weary silo
#

its not secure exposing a port publicly

prisma cobalt
#

oh right yeah i agree with that

#

but its neccasary if you want it to work

weary silo
#

i think aws free tier or any other hoster that offers it like heroku is probably easier to setup

#

and just generally better and less pain

prisma cobalt
#

ill add that into the guide then since i set mine up a week ago lmao

#

purposly for the reason of a static ip

trim moth
#

I gave it a shot, but couldn't figure out shit

weary silo
#

i mean you can host anything anywhere

#

you'd just have to check for traffic/prices

trim moth
#

Hmm

prisma cobalt
#

aws has a free tier that allow constant running of a single script permanently i think

trim moth
#

Coz, as you said it would be easier, so less pain

trim moth
trim moth
#

I'm excited now

#

Can you set me off with some resources?

#

I have the code, just need to deploy it now

prisma cobalt
#

i recently set my TCP Chatroom up on aws servers lol, i can probably walk you through it

trim moth
#

Yeah gimme some time lmao

prisma cobalt
#

first you need to set up an aws account tho

trim moth
#

In class rn

prisma cobalt
#

lol

trim moth
prisma cobalt
#

cool

trim moth
#

Yeah

#

I'll hit you up in a bit

prisma cobalt
#

Many people come here and ask why connecting to a server script using a public IP doesn't work. The main reason is that port forwarding hasn't been implemented on the server network.

What is port forwarding?
When you try to connect to a network, your connection is received by the networks router. Your router understands that these packets need to go to a device on your network but it doesn't know which device to send them to. This is where port forwarding comes in! When you set up port forwarding, you're creating a set of rules that tells your router to forward any packet it comes across on port {configurable port number here} to a specific device on your network. This allows direct communication between an outside source and a specific device on the network.

How do you set it up?
You need to find the default gateway IP first. You can do this by launching command prompt (cmd) and typing "ipconfig", then simply locate the default gateway entry. It may look something like: 192.168.1.254 but it might not be. Copy this IP into a URL bar of a web browser to access your router manager. Once there, you need to locate the "Port Forwarding Settings", bear in mind this could be under "Advanced Settings" if it doesn't appear on the main page. Once you've got that page open, you need to "add a new rule". This should allow you to enter a specific port number (or range of ports) and also a local IP of a device on your network. Once you've confirmed this, all packets sent to the public IP with that port number will be forwarded to that device.
https://www.wikihow.com/Set-Up-Port-Forwarding-on-a-Router

If after a few days/weeks the script stops working out of nowhere, check out this (its possible your IP changed automagically):
#networks message

trim moth
#

Whoooaaa

#

That came out of nowhere lmao

prisma cobalt
#

lol

#

my port forwarding guide

#

due to discord character limits i had to break it up tho

trim moth
#

It's cool!

#

Lemme try that rn lmao

#

But I'm router-less

prisma cobalt
#

Potential problem (and solution):
After a few days or weeks, your client script might suddenly stop connecting to the server, this is most commonly found on home networks. This is because the public IP of the server's network is a "dynamic" IP address which is frequently changed by the ISP (internet service provider) to make full efficiency of the pool of IP's they can distribute. You have two options here, you could pay for a "static" IP from your ISP OR you could use a hosting service (which offers a static IP) to host your server script for you.

Hosting Services
There are a few hosting service that you can use to host your script for you. This allows you to set it up once and not worry about it, it also means you don't have to keep a device on your network running permanently since the hosting service is doing it for you
Free Options: (if anyone knows of any more simply tell me and i'll update it)
Amazon AWS servers - free tier
Heroku not anymore

thin sun
#

gist?

prisma cobalt
#

ah thats a fair point

prisma cobalt
north igloo
#

Trying to import socket but getting an error saying "NotImplementedError: socket is not yet implemented in Skulpt in file src/lib/socket.py on line 1"

#

I am on packet tracer simulation

prisma cobalt
#

Hmm it looks like your python installation didn't properly install the socket module

#

That's weird

north igloo
#

Just to be clear.. I have not done any python installation, I just code in packet tracer

shut compass
#

How Error Solves:

merry hornet
#

anyone has any SDN experience who can help ?

prisma cobalt
#

lol

trim moth
#

What's a packet tracer?

prisma cobalt
#

i think its something like wireshark

merry hornet
#

packet tracer
is a network emulator by cisco

#

what you need it for if for programming dont use it you cant run scripts on it

brazen violet
#

Sorry if this is the wrong place:
I have some code that reads from large files on a windows server, but when i time it over the network and on the server itself, i see that it reads faster over the network. Which confuses me, as shouldnt network reading add some overhead/latency then reading directly?

merry hornet
brazen violet
#

calling:

def getfile(msgpack_file):
    t0 = time.time()
    with open(msgpack_file, 'rb') as myfile:
        print(len(msgpack.load(myfile)))
    t1 = time.time()
    print(t1-t0)
brazen violet
trim moth
#

sometimes network transfer could be fast too lmao, I made file transferring client-server which moves files on the same device when on localhost at like 350-400 mbps while moving files through OS never goes that fast, but that's only for like moving files from one device to other tho, otherwise it's like 6-7 mbps

trim moth
#

well in your case, isn't it a good thing that it's fast

#

Considering "if ain't broke, don't, fix it", you're good

#

lmao

brazen violet
#

lol yaa .. but im just trying to squeak out more performance. Its for a larger project that loads up thousands of files and it takes minutes to run, so i was hoping to off load that loading to the server itself to speed it up

trim moth
#

Threading might help you speeding things up since what you're doing is a io bound operation ig

brazen violet
#

tried that, it helps, still takes minutes

trim moth
#

lol

brazen violet
#

nothing like loading 1/4 of a million files, each file 1-10MB lol

trim moth
#

whoooaa

#

That's a lot of files lmao

#

Now I'm out of speed up solutions after threading

brazen violet
#

Thank you for trying

trim moth
#

nah man, my pleasure

#

Oh wait, you can even implement threading whole transferring files over a network too!

brazen violet
#

what do you mean/ how?

trim moth
#

One sec lmao sport for late reply

prisma cobalt
#

250gb for lowerbound as well

brazen violet
next sapphire
# prisma cobalt

I have that as my public ip and port forwarding setup but for some reason it still won’t work, I’ve been trying things for a few days and still can’t get a connection

clear bobcat
#

Cannot you get a cookie from web browser?

clear bobcat
#

If this website requires cookie I recommends to set User-Agent

#

What is server response?

prisma cobalt
#

show me your code

next sapphire
#

Ok here I’ll reply to my original message, thanks for the help!

next sapphire
#

Here’s the port forwarding (I tried changing the port to 5060 and 10080 in the code and port forwarding but it didn’t work)

prisma cobalt
#

i assume your actually changing the publicIPaddress to the actual ip

next sapphire
#

Yes I am

#

To the ip that the google search gives me

#

I’m thinking either that is wrong for some reason, or there’s a firewall still blocking it maybe? Stopping my antivirus didn’t help however

prisma cobalt
#

@next sapphire do you get the option to enter username on both scripts?

next sapphire
#

Yes I do, then they both hang

#

Also if I switch the public ip on the client to the local ip of the server it works

prisma cobalt
#

hmm, its a probably port forwarding or the firewall as you mentioned

next sapphire
#

That’s what I figured, I don’t know exactly how test port forwarding, but I ran the server and checked if the port was open and it was closed

prisma cobalt
#

i see a problem with your code but it may or may not effect how it works

#

your asking for the username after binding in the server and before listning
change it to ask for username before both

#

actually your acting like the server script is a client which is weird as well

next sapphire
#

Do you mean because it has a username? I had it so the server could send messages like the clients

#

This was just some test code I found and I’m trying to get it to work over the internet before I change it up

prisma cobalt
#

can i write you a client and server script for you to run and test

#

?

next sapphire
#

yeah definitely that would be helpful!

prisma cobalt
#

server:

import socket

sock = socket.socket()
sock.bind(("0.0.0.0", 8080))

sock.listen(1)
conn, add = new_socket.accept()

print("Received connection from ", add[0])

client:

import socket

sock = socket.socket()
sock.connect(("publicIPhere", 8080))
print("connected")
#

a small change but