简体   繁体   中英

How can I bind already existing socket in Python 2.7 on Linux?

How can I sending packets through socket which I already created in my browser? I don't want to create new socket in Python, only bind socket as I mentioned earlier.

You cannot overtake an existing TCP connection from within another process without cooperation of the original process. With cooperation there are at least on UNIX like systems ways to transfer open file descriptors between processes. But to get this cooperation you would need to make changes to the browser.

But, your problem sounds like an XY problem . You should better ask about the original issue leading to this question.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM