network-programming

How to write a standalone URL logger for Windows?

社会主义新天地 提交于 2020-02-05 06:33:26
问题 I want to write a program to log all the URLs visited on a computer, but standalone, so not as a Fiddler2 extension. Are there any libraries out there that do this already that I could include in my application (which I was intending to write in C# .Net, but I'm flexible as long as it's for Windows)? If not are there any that could at least facilitate reading information from HTTP packets? I want to analyse the urls on the fly. Thanks. 回答1: For that, you would have to sniff the traffic on the

How to write a standalone URL logger for Windows?

会有一股神秘感。 提交于 2020-02-05 06:32:28
问题 I want to write a program to log all the URLs visited on a computer, but standalone, so not as a Fiddler2 extension. Are there any libraries out there that do this already that I could include in my application (which I was intending to write in C# .Net, but I'm flexible as long as it's for Windows)? If not are there any that could at least facilitate reading information from HTTP packets? I want to analyse the urls on the fly. Thanks. 回答1: For that, you would have to sniff the traffic on the

List of all hosts on LAN network

我只是一个虾纸丫 提交于 2020-02-02 02:44:50
问题 How can I get all the IP addresses and associated host names in a LAN? 回答1: To get the list of interfaces and IP addresses, use getifaddrs() . Search for interfaces with ifa_addr->sa_family == AF_INET The IP address is in sin_addr.s_addr . You can then use gethostbyaddr() to look up the DNS name for that IP address. Update: It was pointed out to me that the OP was probably asking about discovering other hosts, rather than the addresses of interfaces on the local machine. There is no reliable

udp packet loss and recovery

妖精的绣舞 提交于 2020-02-01 08:53:05
问题 I am working on both udp/tcp based P2P for file and real time video streaming application.the application will be developed for both Linux and windows platform using c++. We are using ICE(TCP/UDP hole punching) to implement the P2P. while TCP ensure the packet loss but for UDP I need a decent approach to make sure packet must be delivered to the other peer. I wanted to know the algorithm or technique to do this. Is there any free thord party tool/libraries to do. Any link and suggestion will

How to preserve source IP from traffic arriving on a ClusterIP service with an external IP?

纵饮孤独 提交于 2020-02-01 04:56:25
问题 I currently have a service that looks like this: apiVersion: v1 kind: Service metadata: name: httpd spec: ports: - port: 80 targetPort: 80 name: http protocol: TCP - port: 443 targetPort: 443 name: https protocol: TCP selector: app: httpd externalIPs: - 10.128.0.2 # VM's internal IP I can receive traffic fine from the external IP bound to the VM, but all of the requests are received by the HTTP with the source IP 10.104.0.1 , which is most definitely an internal IP – even when I connect to

Load balancing server, how can I implement it?

半城伤御伤魂 提交于 2020-02-01 04:51:42
问题 I googled for load balancing but the only thing I can find is the working theory, which at the moment, is the "easy" part for me. But zero examples of how to implement one. I have several questions pertaining load balancing: I have a domain (example.com) and I behind it I have a load balancing server (lets call it A ) which, according to the theory, will ask the client to close the connection with A, and connect to B, a sub-server and carry on the request with B. Will the client, in a web

Client use high port number

拥有回忆 提交于 2020-01-31 05:55:09
问题 Why does the client end of a connection use high port number(ephemeral ports) whereas the applications listen on typically small port numbers ? Thx in advans, Karthik Balaguru 回答1: Ports numbers under 1024 are called "registered", while those above (limit of 65,535) are called "unregistered". All these two terms mean is that ports under 1024 have standard services associated with them. IE: 53 for DNS, 80 for HTTP, 25 for SMTP, etc. Note they are associated - there is nothing to stop you from

InetAddress.getLocalHost().getHostAddress() returns 127.0.0.1 in Android

こ雲淡風輕ζ 提交于 2020-01-31 05:41:04
问题 My application uses multicast to send a beacon in periods along with protocol message and ip of the host joining the multicast group. In android device it is returning 127.0.0.1. I have looked around and found that many people suggested changing a host file. But, in case of android it is not possible in my context. How do I get real IP of the device, not the loopback address.. private void getLocalAddress() { try { String localHost = InetAddress.getLocalHost().getHostAddress(); servers.add

Return VBA Network Drive Letter for Different Users

久未见 提交于 2020-01-30 08:37:06
问题 I've created a portal for myself and coworkers to download workbook templates that reference different network drives in an effort to consolidate. The portal is hosted in the "Accounting" (Z:/) drive, but one of the workbooks references a spreadsheet in a different drive "BI" (Y:/). This works splendidly on my machine, but my coworkers have different drive letters (e.g. M:/Accounting, U:/BI). Is there a way to search a network for a name and return the drive letter? Here's a rough

send and receive request via sms instead of http

独自空忆成欢 提交于 2020-01-25 18:09:00
问题 in my android application I want to send requests to server via sms if there was no internet connection or network. I am changing the Volley library code. http request is synchronous, when you send the request, thread waits until the response or error get received from server, but when you send sms, thread continue to work and doesn't wait to get the response sms so I am forced to use Callback functions(listeners). is there any better approach. is it good idea to use wait and notify to make