Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8189083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T03:09:20+00:00 2026-06-07T03:09:20+00:00

I can do simply socket communication on the same machine using server: import socket

  • 0

I can do simply socket communication on the same machine using

server:

import socket

s = socket.socket()
host = socket.socket()
port = 8000
s.bind((host,port))
s.listen(5)
while true:
     c,addr = s.accept()
     print 'got connection from', addr
     c.send('thank you for connecting')
     c.close()

client:

import socket 

s = socket.socket()
host=socket.gethostname()
port = 8000
s.connect((host,port))
print s.recv(1024)

What changes would need to be made have this communicate between my laptop and a private server I work on? I have figured from my searching that portforwarding is the best way to go about it but haven’t found any explanations or tutorials on how to go about it.

thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T03:09:21+00:00Added an answer on June 7, 2026 at 3:09 am

    If you care about Python port forwarding implementation, there’s an old but great ActriveState recipe that implements asynchronous port forwarding server using only Python standard library (socket, asyncore). You can poke around at code.activestate.com.

    P.S.
    There’s also a link to a threaded version of the script.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have recently written a socket server in PHP that will be handling communication
I've been using gimite / web-socket-js to implement a WebSocket past simply Chrome and
I have a script that opens a port and allows socket communication between multiple
In Android Development, I can simply start another Android App with data from my
I'm trying to make an applet which I can simply drag an image. And
I hate generating an exception for things that I can simply test with an
When you declare a type parameter for the class, you can simply use that
I simply can not get Visual Studio 2005 to find the System.Configuration.ConfigurationManager class. Here
How can I simply disable a TkInter Listbox? It seems such a straightforward thing
I just simply can't figure out how to set NSDateFormatter date format so [formatter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.