简体   繁体   English

使用浏览器作为python套接字中的客户端

[英]Using the browser as a client in python sockets

I need to build a server which can connect to the chrom browser (The browser need to be a client) in TCP protocol, and get from the browser some URL and check if the file it recieved exist in my computer. 我需要构建一个服务器,该服务器可以使用TCP协议连接到chrom浏览器(该浏览器必须是客户端),并从浏览器获取一些URL,并检查其接收的文件是否在我的计算机中。 This code below is work only I use a regular client that I build, and not a browser client. 下面的代码仅在使用我构建的常规客户端而不是浏览器客户端时才有效。

My question is: How and where do I can send data from the client browser to the server? 我的问题是:如何以及从哪里将数据从客户端浏览器发送到服务器? How do I connect to the browser from the server? 如何从服务器连接到浏览器?

In order to connect the browser to the server (your app ) your url should look like this 127.0.0.1:12397 . 为了将浏览器连接到服务器(您的应用程序),您的网址应类似于127.0.0.1:12397。 i am just not sure how are you planning to send the GET request , but now the request will be intercepted by your app ONCE SENT. 我只是不确定您打算如何发送GET请求,但是现在,一旦发送,该请求将被您的应用拦截。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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