#networks
1 messages · Page 28 of 1
somebody who want's to help me with some coding
what do you mean?
hey i need help how do i send packets to a ip address
if someone can help me dm me please
TCP/UDP? Sockets?
You gotta give more info
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
yep your missing a ")" on the end
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
sockets
i am trying to spam sockets to a custom ip its a dos attack i am making it to pen test my servers to see the strength of my server
hmm have you ever heard of rule 5?
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
lol
should i be worried about security when i forward ports?
hello
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
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
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
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
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?
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
does your chat app work on remote socket connections too? i tried this too but only the devices on the same network were able to connect to each other
hi
it means your not properly connecting, describe what your were/are trying to do
check the firewall, port, ip and so on, as Evorage asked, can you describe the steps you took?
if your connecting to an external network you probably havent port forwarded anyway
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
whats your understanding of sockets like and have you started this yet (if so, show code)?
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
sockets work with devices on different networks, if you mean to create a chatroom of sorts then i highly reccomend neuralNines video (link in channel pins)
But, I don't understand how come devices on different networks can connect? I spent almost whole day trying to figure that out, can you tell me more on it please?
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
Yeah
But I have a sim card lol how do port forward on that?
your... using a phone?
oh
Sed lyf
that makes things almost impossible to do since your connection changes ip really frequently using data
But I would get one soon
But the laptop's ip from ipconfig remains the same
does it start with 192...?
Yeah, it's a local ip
Yeah
but to connect from other networks you need your public ip which, with a phone, is impossible to use since it changes
So I need a global ip from a router with the desired port forwarded and then run the socket server
Am I right?
yeah pretty much
What's other than the pretty much part which is left?
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
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?
lol, once you get your router and need some help, ping me
when do you think your getting one?
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
yeah lmao
Thank you so much, I really appreciate your help, I don't have any confusion now
no problem, just message me if u need more help in the future
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?
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
Yeah
Not really machine, but a linode server or something
if its running an os that supports ssh then yeah i gues
And are there some free services for that? lol
for sshing or server os's?
for sshing
most os' like windows and linux already support it as a default service for free
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
I swear you or someone else very recently asked this
i did but its not like that ...
What do u mean?
and i really dont know how
Use the time module
So do
Start = time.time()
Before message sent
Then do
Print(time.time() - start)
After message received
XD let me figure this out
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
Your sending the time?
?
can u dou the code i really dont undersatnd ?
is it possible to use sockets with proxies ?
A socks five proxy is just a socket that allows for relaying connections
You should look into the protocol
https://pastebin.com/D1GLRqfR
that's weird, but register func works, registers me, directs to login func, trying to login, the input is empty, nothing happens
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
any ideas?
hi
Is there a socket for HTTP for example: socket = socket.socket(socket.AF_INET, socket."HTTP")
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
Is there a TCP socket?
socket.SOCK_STREAM as the second argument
Like?
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?
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
I used that socket but it gave me this error: [WinError 10057]
what is the error message?
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
what address do you bind to?
My IP
thanks, hope it will help me
No problem
and what port?
80
what line raises that error?
Well, Is there a similar socket like UDP for data sending?
what
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.
ahh something i can help with since ive gone through this process
k
first, reinstall pi os lite on your sim card
will do
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?
no i'm using etcher
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
are you using discord.py or discord.js?
py
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
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?
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
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
I don't need the key manager?
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
well it deletes as soon as you boot it up because it gets written straight into some folder in /ect/
yep i got it, the thing i put above is all you need
anyways done
okay eject the card from your pc
okay.
right click on the storage media widget and eject
yup
did you enter the correct name and password?
yes
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?
nope
okay that makes it slightly harder
that happened to me too, what i did was install "fing" on my phone which detected it
i'll do that.
the app has a blue icon with a white circle thiny in it made up of dots and lines
got it. now what
yup
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)
nothing
theres a light on your pi... is it flashing or stable?
the power is finicky if I touch it but right now it's stable
finicky power?
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?
not on me no
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)
nothing
hang on, in your wpa_supp... file, did you surround the ssid and psk with double quotes?
yes
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
okay just checking
damn thats frustrating
i know ;-;
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
it might be my firewall maybe?
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
router is right behind me
so its a zero w?
damn thats the last issue i can think of
sigh
sorry, i have no idea why its not connecting then 😢
thanks for trying. I appreciate it.
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
yeah I might have to. if that doesn't work then i'll just have to buy another pi zero
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
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.
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.
does someone here have experience with ftplib i have a problem that i need help with
hi
i have some questions
ask away
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
guys how much a servers too rent
check aws 😄
aws?
i dnt know what kind of server you need
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
just a bog standard group chat for my family sort of thing
ok
what are the bounds of it tho cusi dont want my mum to scream at me why have a been charged something
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
and there is no way to set upper limit in amazon of how much do you want to pay
also is there a maximum data thing on the free server
but you can set notification that if you will reach overr set value you will get email that $$ is reached
is that on the free server
5gb is free
its about s3
i will log in to aws and check ec2 size
it says 12 months free??
after 1 year are you charged??
ok
yeah ec2 is only free for 12 month, then you will have to make another account on aws or transition to another cloud
how do you cancel it after 1 year
just delete your server in aws
hmhmhm it will be easier if you take some aws tutorials
ok
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
thanks
the amazon servers are a good choice for free hosting?
@ember ledge technically can you use a wifi router as a server for it as it has an IP and a PORT
12 months are freee, s 1 year is okaish
you said earlier there was a 750 hour limit or something?
so i cant run a low resource script permanently for free?
if you have public adres from your isp then you can map ports to your home server made from raspberry pi and then load your app to raspbery pi and then use your app no aws
so you could use a wifi router as a server?
yes
totally you can use 750 hours free with ec2
if u use 2 instances of ec2 then free you have 750/2 hours in a month running simultaneously
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?
if that is a enterprice router then you can, I strongly disagree that your home wifi router can run some written aps (and in python), but pls check the name of you router and let me know
its some BT one
you dont conclict with other instances
with other instances of other users
but... how if i specifiy the ip and port, couldnt another user use the same ip and port?
ahh vps majic
i think...
huh?
aws manages public ip's so there cant be a confict
no i know how to make a chat script, i was just wondering if every user of the amazon servers have a different ip
ahhh
can we use it??
then you can use any (>1024) port?
you can connect to it but you cant process data sent to it
why?
because its not yours 😂
you dont have access to the server script running on that ip
i c
i think that only those are restricted
Checks whether security groups that are in use disallow unrestricted incoming TCP traffic to the specified ports.
@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
is that your server @ember ledge
and in my work i did saw some undesirable traffic from port 53 and 123 from aws ec2...
is that your server in the pic you sent?
if you restart instance then the ip will be different
you should use dns
i have a domin name but i have to enter the target ip in the hosting website and if it changes then its pointless
yeah this is the one i made when i made pscreens for you
then use domaind in aws https://aws.amazon.com/getting-started/hands-on/get-a-domain/
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
they change only if you will shutdown your instance
if its running 12 months
with no breaks thatn you will have same ip xd
but theres a 750 hour limit?
yeah
your saying i can run it for 12 months?
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
until you shut it down, never
as seen in the screeen from google xd
now i need to sign up for aws lmao
still you should use some aws tutorials and think about using dns of aws >>> i dont know the price tho ;c
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?
hey need some help with threading (more specifically, PID), could anyone help me?
@neat mango can you ask the question, coz how're we supposed to answer if there's no question
hey, any ideas what kind of sockets are there in iproyal pawns, honeygain, packetstream and etc
share internet without proxy forwarding
p2p?
upnp?
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?
I mean cron is a way of running the program every x time
Alternatively you keep keep your code running permanently and just sleep for a bit in between requests
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?
specific request or response?
specific request
that request is getting send everytime the page is loaded
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?
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
yes it is possible to make such a program. I can help you but you have to write the code yourself obv. I cannot write it for you
use the requests library python. Take a look at this https://www.geeksforgeeks.org/response-headers-python-requests/
to schedule tasks take a look at this https://www.geeksforgeeks.org/python-schedule-library/#:~:text=Schedule lets you run Python,when a task should run.. But for a more production ready solution you can use celery
yeah but be sure to google first. Your first consultants should be google and stack overflow
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
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.
closed port: packet bounces off
open port without code listening: packet bounces off
open port with code listening: depends
depends on what? on my code?
hi
You can whitelist IPs. So only whitelisted IPs can connect to your socket server, so you will have no problems there. Use a port which is not already forwarded and used. And I have a question of my own : How will you forward the port? I tried many times myself to forward the port in my router but couldn't do it
Hm
I needed a module, which is like the net module of js, for IPC connections. Anyone knows?
idk
ah i see. well ill now i know. about your question: through my router's panel. like what i mean is you just enter the default gateway into some web browser and then you do magic 'n' stuff
ohk. I tried router forwarding many times but didn't work for me. Anyway good luck!!
thanks you.
depends how the setup is
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
I didn't understand 99.9% of what you said... I'm not good at networking as you can see. Still learning tho
you have a public ip and a local on
you NAT your public one to your local one so the traffic gets redirected
ok
by doing your service is visible to the whole internet
and vulnerable
thats why you add something like a country/region filter
oh.
so only specific regions have access to the service
you also should put a reverse proxy infront of your service
do i do that in the code or router takes care of that?
oh.
lmfao i have no idea what those are too
anyway. ill add a geo filter or whatever you call it. i need to look into that
yeah geoip filter
maaaaaaaaaaaaaaaaaaaaaaan. i cant do networking for crep.
alright. btw whats the worst that could happen if i get hacked? i don't have anything interesting in this pc soooo..........
@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
so they have servers that i can host crep on for free?
aws has a free tier yeah
it allows outbound connections and stuff?
yea
noice. ill look into it.
oof. im just trying to host a site that says "Pingas" lmao
why
just do it locally if you wanna test it
why would u want to expose it online then
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"
alright thanks.
@modern edge are you still trying to port forward?
no
i wanted to do it earlier
a year ago
lol
Didn't you ask today in this chat?
i did but just for my reference.
So your not still interested?
yeah. just trying to figure it out
Whose your ISP?
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
lmao, it hsould be same tho if you want some help?
yeah. its all the same NAT and LAN and LDKSJDKJSDNLKGJ
all the networking crep is there
lol, do you know how to open the router config menu from a web browser?
yeah
then port forwarding should appear somewhere?
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
oh right lmao
whats the worst that could happen really?
Unless your script behind the port does system commands then nothing bad really
oh. well no system commands. and that is for sure lol
What r u planning on making?
i want to get into sockets, websites, and networking in general
as you can see i have a loooooooooong way
Lol
i cant do networking for crep
The sockets arnt that hard, it's the websites and stuff that's difficult for me
There's chatroom code in the channel pins
alright.
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?
Yes?
ghost ping
Do you have anything to report to the moderation team?
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.
@small mango
You should DM ModMail for anything that doesn't require immediate action from us within the server.
ok
That would be something to tell us about over @small mango, but if that's true, you should report that directly to Discord.
wth
i am just trying to help people out here
Please refrain from discussing this on the server
ok
k
we can't litigate what may or may not have been said over DMs, as we're only moderators for this server.
what's happening?
Then how does duck mail moderate it?
You can read what has been said, but please don't discuss it. This is off-topic.
yeah ok
That's fine. Please resume discussing networking.
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?
networks networks networks networks
do you know if the wall plug goes to your router/modem
idk
how do I know?
Check your router?
I use google home router app, how do I check it from there?
@faint hemlock sorry to ping, I did a screen recording of @modern edge writing shi* in my DM
it is in modmail
!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.
:incoming_envelope: :ok_hand: applied warning to @static prawn.
put this in #discord-bots
Gotcha
bruh
Check the physical router
yes? it is just a router
How am I supposed to know?
Check and follow the cable?
If it goes onto the wall and if that would reach the room with the wall plug
no I connect the google router's ethernet cable to the modem
and the powerplug to the power outlet
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?
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
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
so for a, i did 2^23 / 602 mil
why
and per person
i was wondering if you guys know where i can get help with networking homework if i cant get it here
What module should I use to work with websockets?
Are you asking about something similar to socket.io?
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.
can i ask question about async requests in this channel?
Yo guys
It would be very nice if you would fill out this survey. It is 100% anonymous and helps me a lot with my plan for a major project. https://docs.google.com/forms/d/e/1FAIpQLSen7VgFpHEIumRGZjXPZXoNFmDvzUYCYv2CiCkOr69yC1ZoiQ/viewform
Feel free to send the survey to other people. The more you participate, the better ...
Will each player(client) be running python or in a web browser using JS?
python
are you able to the the standard asyncio event loop or a separate game loop on the main thread?
what type of websocket communication, python -> python or web browser -> python?
i used multiprocessing. A process for every lobby created but now i realised it's all wrong
udp multicasting, python 3.9 if I understood well the question
could you join a call? maybe it would be easier to explain
Hey @ember ledge!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
@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.
@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!
Is your lobby on local host?
Python to python?
what can i use to connect remotely to a windows machine not on my network?
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
pyenet is not receiving anything but sockets are when i tried
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 ?
ok tysm
np
What about this btw
check out networkchuck. He's a youtuber who gives networking tutorials
Thanks alot
Welcome to NetworkChuck!
I LOVE Information Technology!! My goal is to help as MANY PEOPLE AS POSSIBLE jump into a career in the IT field through obtaining IT Certifications. I talk about Cisco Certifications, CompTIA, AWS, Microsoft...pretty much EVERYTHING in IT. As a CBT Nuggets Trainer, it's also my passion to TEACH information technology a...
no problem
127.0.0.1 is the IP of the device when on localhost lol
Yeah, absolutely
I suggest working a bit with sockets to learn more about networking
One sec
i have once made a game in sockets :D
it was a tough experience.
unfortunately i lost the src code when i was uploading it to github 😦
so practically localhost refers to the the IP we Get assigned by our wifi?
This
Is
Gewd
@queen lake
Gewd ?
Nah, not exactly, the IP assigned to the WiFi are of two types, public ip and private ip
Good lmao
ok lol
yeah i meant to say the IP wifi assigned to the device we are hosting server on
Whereas, localhost is the default IP address for every pc in the world when the pc is not connected to a network
Yeah
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
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
You got it man!
lmao I was in the middle of typing this
Yeah, check out that gewd article and you'll possess the superpower to transferr files from one pc to another
sure
And DM me if you ever need anything
Could anyone tell me what can happen to a thread if its not locked?
No idea
Can i make a realtime chat application with some big features
with python sockets ?
I am new to python networking side
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.
no no guys
i dont want to use flask or socket io
i am asking about default socket module
then?
what is the problem there
wait what is special in flask
and socket io
?
@lone kettle are you sure you can make a .exe using flask and socket io
no
you didnt understood by .exe
i mean a gui chat application
with some big features
like discord
with ui
@lone kettle
i guess flask has UI
is there value in getting a certificate from a course like https://www.futurelearn.com/courses/networking-with-python-socket-programming-for-communication
or should i just do the free version
for now yes but I want to make it public
the learning is much more valuable than the certificate, particularly if you have to pay for the certificate
and in general employers will be much more interested in projects you've done than online certificates
so probably don't pay for it
How do you plan to do that?
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
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.
Yeah please do tell me when you do, and don't worry I'm not in a hurry lol
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).
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?
The port forwarding tester is a utility used to identify your external IP address and detect open ports on your connection. This tool is useful for finding out if your port forwarding is setup correctly or if your server applications are being blocked by a firewall.
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])
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))
how did you set up port forwarding
@storm saffron I have it setup through my router like this -
encrypted tcp session is possible?
@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
Anyone able to help me with an issue I have with google cloud? I've been trying to fix it since yesterday, no success
HI I have a problem with a yesterday script does not go and I do not know why, you can help me?
Hey @shut compass!
It looks like you tried to attach a Python file - please use a code-pasting service such as https://paste.pythondiscord.com
hi, i wanna to know how can i check a certain mac address is online within the same lan?
does anybody know why the enemy ponger is jumpy for only one person?
@ Caffeine (don’t want to ping) will do thanks!
what does modem do
It's okay to ping lol I don't mind, lemmino if it works or not
Ok definitely will do, I’m away from my pc most of the day but I’ll try to give it a go later today, thanks again for the help!
lol
Struggling to get ubuntu server online. Is this right channel to ask for help? :)
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...
did u check any firewall restrictions
also what stack are you suing
*using
that way I can help you out a little better
Amazon aws servers?
If yes then there’s a trick to it that you have to do first
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...
Thanks! That was my machine. But I wasn't aware of the aws trick...
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?
@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
This is wierd
Is there a module i can ping the mac address and reture a Boolean ?
@prisma cobalt can you help please?
Did you get your public ip from Google or your router admin page?
I never heard about something similar to it. The easiest way is to check on router because even when you prepare packet “is-this-mac-alive” someone must answer to it 🤔
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?
As far as I remember BrokenPipeError means that connection is closed? 
the thing is, its not closed...
Which library are you using?
Scrapy? As i can see it can send a packet to a certain addrss
I am not sure that it is going to work
Between you and target there is a router/switch and you cannot send packet directly
Can you reduce delay between packets? Like sending some heartbeat more often?
I had this problem when GIL blocks the thread
what do you mean GIL blocks threads? i have only two of them.
more clients that join, more threads
I have my own extension written in C (using Python C API) which totally blocks all threads. Already it's fixed bug however it prevents from sending heartbeat
Oh, I am talking about client-side
Theres no threads on client code.
Maybe you should start with brief introduction into your chat application 
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?
I don't think so 
crep
Are you sending something like keep-alive packet to prevent from disconnecting?
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"
ah. so its life support lol
anyway, how do i do that? maybe it can solve my problem
I never used heartbeat or keepalive option with raw sockets but I see that this is something like SO_KEEPALIVE
This page shows Python examples of socket.SO_KEEPALIVE
i didn't know tcp just closes itself like that.
oof i should save some time to read the docks 😄
Reading docs is always a good choice 😂
alright.
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
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
Agree
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
ah no, i was just wondering if you where using the amazon aws servers to host whatever since they require some work to actually connect to the internet from lmao
guess not
huh?
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
just need to go in your routers settings thru the webinterface and add it if they support it
yeah but saying that doesnt help the majority of cases since they dont know how to do that
im making a guide now
also you should probably look into aws free tier and other stuff since you mostly have a dynamic ip anyway
fair point
- they would need a bit more setup than just post forwarding
?
i didnt have to, it depends on the router i think
no
oh?
its not secure exposing a port publicly
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
ill add that into the guide then since i set mine up a week ago lmao
purposly for the reason of a static ip
Then can I host my TCP socket chat room server on aws or heroku?
I gave it a shot, but couldn't figure out shit
Hmm
aws has a free tier that allow constant running of a single script permanently i think
Coz, as you said it would be easier, so less pain
And anyone around the world can connect to the ports is considered in the script?
yeah you can set that up
I'm excited now
Can you set me off with some resources?
I have the code, just need to deploy it now
i recently set my TCP Chatroom up on aws servers lol, i can probably walk you through it
Yeah gimme some time lmao
first you need to set up an aws account tho
In class rn
lol
Yeah, I can do that rn
cool
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
lol
my port forwarding guide
due to discord character limits i had to break it up tho
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
gist?
ah thats a fair point
Are you the same guy I talked to a few days ago who was asking for a router for their birthday?
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
Hmm it looks like your python installation didn't properly install the socket module
That's weird
Just to be clear.. I have not done any python installation, I just code in packet tracer
How Error Solves:
Warning (from warnings module):
File "AppData\Local\Programs\Python\Python37\lib\site-packages\urllib3\connectionpool.py", line 847
InsecureRequestWarning)
InsecureRequestWarning: Unverified HTTPS request is being made. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings
anyone has any SDN experience who can help ?
Lmao glad you remember me
lol
thats your problem i think
What's a packet tracer?
i think its something like wireshark
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
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?
it depends of various things such as the computer specs and other things
how are you measuring this?
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)
on both my pc (via network path) and the server (with local path), to the same file
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
ya ive seen that as well
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
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
Threading might help you speeding things up since what you're doing is a io bound operation ig
tried that, it helps, still takes minutes
lol
nothing like loading 1/4 of a million files, each file 1-10MB lol
whoooaa
That's a lot of files lmao
Now I'm out of speed up solutions after threading
Thank you for trying
nah man, my pleasure
Oh wait, you can even implement threading whole transferring files over a network too!
what do you mean/ how?
One sec lmao sport for late reply
250000 * 10 (upper bound) = 2500000mb ~= 2.5tb
wow
250gb for lowerbound as well
334GB of heavy compressed zips so far, but ya about 1.3tb
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
Cannot you get a cookie from web browser?
If this website requires cookie I recommends to set User-Agent
What is server response?
are you sure port forwarding is set up?
show me your code
Ok here I’ll reply to my original message, thanks for the help!
Here’s the code
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)
i assume your actually changing the publicIPaddress to the actual ip
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
@next sapphire do you get the option to enter username on both scripts?
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
hmm, its a probably port forwarding or the firewall as you mentioned
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
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
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
yeah definitely that would be helpful!
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