Masking IP on the Windows Phone - c#

I am attempting to provide some anonymity to my users on the Windows Phone when they post data to my server.
Without going into to much detail, the only thing that ties the user to the data in my database is the ip they call into my server from. I would like to mask this.
I have looked into creating a WebProxy object but apparently this isn't available in the Windows Phone .NET framework.
I am considering just informing the user of their exposure and making it easy for them to setup a VPN on their device.
Is there another way I can mask their IP when they call into my server? The more automated I can make it for them the better.

You can't mask it entirely inside your app becuase the network connection won't work, but you can maybe use third party services like Hola

Related

Implementing phone communication with my C# application

I want to have the app i am creating to communicate with my personal android device. As in, my application will be monitoring something on my server, and when something changes it needs to somehow send an option to act or ignore to my phone, and my personal reply (Yes/No) should be send back to the server.
I don't mind any specific protocols. Anything which does not require an app running actively on my phone would be nice, but i am not that great with android native development so if it can be done it should be relatively simply to achieve.
My own idea would be to actually implement Email somehow. So my phone could get an email on my google account (which in turn creates a notification), to which i would send a reply email with my reply. Which in turn will be read out on my server.
The bad part is that i would have to actually open gmail and type out a short message to send back as a reply. So anything easier then that would be a great thing.
I have seen newer android 6 apps use custom buttons in notifications in order for the app to act on, but i have no clue how hard those are to implement and rig to my reply.
Please note that this application is probably nothing that will go public. So i am not going to bother to worry about load or efficiency in the end of it. Since it will be just me and my server.
Any input would be greatly appreciated. The most convenient/easy-to-use method will be marked as the answer.
I think...u can use xml-rpc " http://xmlrpc.scripting.com " for communicating with your server and android app.
I used it in my personal project and found iI to be useful.In my case,I used wordpress as framework so any new updates in my server is notified by this protocol.

How to load balance a chat server?

i have a dedicated server that run a chat server made by me. But the server is almost overloaded and i want add another server to balance the users.
The servers are both a Linux Ubuntu 12.04 server and the chat program made by me was developed with c# and .NET with Mono.
The problem is that if i open another chat server on the other computer how can i make that the users can communicate between the two servers?
I will try to explain better:
User A is connected to Server A.
User B is connected to Server B.
If the user A send a message to user B that is connected to server B how i can redirect the message to the other server? What is the best solution?
Thank you in advance.
Firstly, whenever you have a performance problem, you should first try to measure where exactly it lies. Maybe you can improve the performance of your system dramatically in some way by looking into why and where it is slow. This way you might not need to scale your system at all. You could also try to scale up instead of out, which is generally easier.
If that fails I would suggest to switch to an existing chat system like XMPP or IRC. There are great XMPP libraries for C# so this would be the best solution I think.
Lastly, when you really want to scale out your own chat system in the way you described, I would suggest to just send messages as JSON over TCP. You can use fancy RPC stuff or REST APIs but for this use case I think you should keep it as simple and lightweight as possible.
It depends which part exactly is missing. There a many parts to a load balanced system.
My guess is that you are missing the backing part, which might not be so obvious.
IPAddress -> Load Balancer <= x-Servers => Backplane
This is simliar to what we used in our case for the back part:
http://www.tugberkugurlu.com/archive/scaling-out-signalr-with-a-redis-backplane-and-testing-it-with-iis-express
I hope it points you in the right direction.

Sending a data from android phone to pc?

I am creating a "tracking system" for my android phone. Basically, the phone would transmit it latitude/longitude to a C# program that will receive the coordinates and display it on a map. I managed to get the phone's latitude/longitude coordinates but I need a way to transmit that data to my C# application running in my PC. I know my way around C# and Java but never really got into network programming. Is there a way to do this ?
I'd look into C# Webservices, very powerful. The communication protocol is SOAP (Simple Object Access Protocol) which is a popular and well supported standard.
Good starting reference: Your first C# Web Service
I can't speak to the C# side of it, but if you write a C# server to receive post requests, the Apache HttpClient makes it relatively simple to send requests. There are a bunch of other questions on SO that will help with setting up the client side on your phone if you poke around a bit.
You have different way to do it.
The first is to send data over the cloud to interact through distant server. So the both devices have to be connected to Internet
The second id to send the data over a local network so the data have to be on the same network and have to share their IPs
The third is to use adb forward which allows to build a socket connection between the 2 devices over a USB cable. The requirements are that the phone have to be on debug mode I think and that the driver are installed on the PC so the phone is recognized by ADB.
I can add one more by using a Bluetooth connection. Find information here
The correct way to do it would be to build WCF service which allows many different protocols to receive data. This would could be a very powerful solution that can be extended in future.
The fastest and easiest IMO would be to create ASP.NET MVC application, define a POCO Model for your longitude/latitude and create an action that would take your Model as parameter. Then use HttpClient and HttpPost on android to send the data. The trick here is to name the variables in your post request same as ones you define in your C# Model.

C# - SIP Control

Ok, I have a VOIP Phone. I know the IP address and the port of the phone and have full access to the phone, which I am using to make SIP calls via a SIP trunk.
I basically want to see what is going on on the phone at any given time and I don't know where to start.
If I started, initially, using Wireshark what type of network traffic would I need to look for?
Could I use Putty and view activity on the phone that way?
What part of the .Net framework would provide functionality for interfacing with a VOIP phone?
Thanks
(Most) VOIP phones uses UDP communication, so you would use the UDP functionality in .NET. This can be raw sockets or the UdpClient class, which is a nice starting point.
You can look in Wireshark for UDP communication that has the phone IP as endpoint. You should try to get the network protocol documentation for your specific protocol/phone, or it is likely to take you a very long time to deduce the messages you need to send.
Wireshark has a built-in SIP processor
According to http://www.splicecom.com/document-area/doc_download/272-maximiser-protocol-a-port-information-for-ip-networks they have several protocols providing different information which you can access to achieve what you describe.
Another option is to use the the TAPI provider they offer to access the information you want.
Some starting points for TAPI via .NET:
http://www.codeproject.com/KB/IP/devangpro.aspx
http://www.codeproject.com/KB/dotnet/CShart_TAPI_3x.aspx
http://www.codeproject.com/KB/IP/Video_Voice_Conferencing.aspx
http://msdn.microsoft.com/en-us/library/ms734214.aspx
http://msdn.microsoft.com/en-us/library/windows/desktop/ms734257%28v=vs.85%29.aspx
Another option is to build a SIP proxy which allows you to do all sorts of things including the things you described:
http://www.codeproject.com/KB/cs/SIP_stack_with_SIP_proxy.aspx
http://sipsorcery.codeplex.com/
http://www.independentsoft.de/sip/index.html
http://www.konnetic.com/products/products_sip_sdk_std.aspx
http://www.voiceelements.com/Products/VEToolkit.aspx

Track messages though Windows Live Messenger

I would like to track messages sent and received though Windows Live Messenger. I would then like to collate these messages into a database (not in the scope of this question).
The question is how and where should I track these messages. The simplest way it to force all clients to keep history files and read those, but it is not really the solution that I am looking for. Is there a way to track them from a server running in the same domain, I have read a little into Windows Communicator, I have also seen a lot of people chat about http://dev.live.com/messenger/ but I was hoping that someone may have addressed this problem already :)
I would like to do this using C# .NET 3.5
Check out MSNPSharp. Its a .NET msn library. Its very powerful and allows you to sign in from multiple locations. So you can sign in and listen to other conversations happening on a given account.
Its very straight forward to use. Download the full source code, there's a sample application that demonstrates its use in full detail.
http://code.google.com/p/msnp-sharp/
Here is two idea that might work.
The first one is the easiest but can be easily avoided by the user if he doesn't want to be logged. It would be to use MSN Plus over the MSN. With MSN Plus you have an API that let you get all messages from any Chat Windows... and a lot more. Of course, if the user is not you, the user can simply uninstall Msn Plus and your program will not log any data.
The second idea is better if you have a network that you require to check all Msn Conversation. If you use WireShark you can see that conversation are not crypted (well the last time I did it) and you can check the port and protocol to simply get the data from the network.
Hope it gives you a way to what you need.
Just two ideas
1. First the standard MSN protocol is plain text (from what I understand) so you could intercept the messages on the firewall and then put them in the DB and do the correlation there.
2. If this is in an organisation you could use Office Communicator which is the "corporate" version of MSN and has that functionality built in already. You can then just go in via their SDK and get the correlated data.
I managed to find two ways of doing this, though both are not really programmatic solutions, so may not appeal to this audience.
Make use of a Jabber gateway to set up forwards between your jabber client and the other IM networks. Traffic flows between your jabber enabled client and the jabber server via the jabber server. The Jabber server then translates this to the destination networks protocol and forwards the message. Likewise messages from the external IM networks are routed and translated by the Jabber server. An example of this is PSI <-> IceWarp Merak <-> MSN
Make use of Symantec IM Manager to intercept messages from the messaging clients on your network. You will need to either use host files or local DNS rules to convince the your local PCs that Messenger.hotmail.com is actually located at 192.168.0.59 and not at Microsoft.
Hope it helps other people that may want to do the same.

Categories