client

Sending multiple variables through a socket?

允我心安 提交于 2019-12-24 10:08:02
问题 I recently started learning networking with sockets in java. So i've created a multiplayer game that is playable on the same computer but i wanted to make it network-multiplayer, then i learned about sockets, now, i want to send the variables of the position of the player in the game to a server which then can place that player in that position in the other game instance running on a different machine. And the thing is, i just fail at it and all the data doesnt get received or read. I also

In ASP.NET, how to hook postback event on clientside

百般思念 提交于 2019-12-24 09:58:47
问题 I want to run a code on every postback on client-side. Is there an event or something to do that? 回答1: If you just handle a form's submit event, you won't necessarily catch every __doPostBack() . A __doPostBack() that triggers an UpdatePanel refresh doesn't submit the form, for example. One way that you can make sure you know about every call to __doPostBack() is to redefine it: var oldDoPostBack = __doPostBack; function __doPostBack(eventTarget, eventArgs) { // Your code here, which will

Change Browser download folder using C#

风流意气都作罢 提交于 2019-12-24 09:53:44
问题 Is there a way I could change the download folder of the default web browser using c#. 回答1: Concurring with other's comments, you can only do it in a desktop app if you have the right permissions. Here's some sample code to find out the default browser of the system (from this post): private string getDefaultBrowser() { string browser = string.Empty; RegistryKey key = null; try { key = Registry.ClassesRoot.OpenSubKey(@"HTTP\shell\open\command", false); //trim off quotes browser = key.GetValue

Java simple server/client console chat application

隐身守侯 提交于 2019-12-24 09:49:44
问题 I want to create a simple server client application, but i think there is something wrong with the IO Streams. There is no GUI so the chat shall happen through the console( you can open 2 eclipse to test it or whatever IDE you are using). here is my server code: import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import java.net.ServerSocket; import java.net.Socket; import java.util.Scanner; public class Server { ServerSocket serverSocket; Socket

Client side SSL certificate for a specific web page

旧街凉风 提交于 2019-12-24 09:13:23
问题 Can a particular web page in a web site, authonticate a web request using client side SSL certificate, while others don't? 回答1: It's possible using SSL/TLS renegotiation. The way to configure it depends on the server you're using (and whether it supports it). Note that, at the end of last year (October/November 2009), an SSL/TLS protocol flaw was discovered regarding this feature. SSL/TLS stacks that support renegotiation based on code before that will be vulnerable to the attack. Most

Resize image with jQuery

对着背影说爱祢 提交于 2019-12-24 08:20:18
问题 The scenario: I’m building a website, which will not Host the images in its own server. Instead it will reference images from other servers. Example: The website is hosted at www.mywebsite.com, and the html of the images will be something like <img src=”http://www.otherwebsite.com” /> . The images from the other servers will be already compressed, so they won’t be very heavy… although they will have around 25KB each, with 500x375 pixels. The objective: I want to resize them on the client side

How to authenticate websocket client in jetty?

别等时光非礼了梦想. 提交于 2019-12-24 08:15:37
问题 I am using embedded jetty on server side which will accept both http and websocket requests. I am using org.eclipse.jetty.security.authentication.FormAuthenticator for authenticating user. After user gets logged-in, my javascript code will open up a websocket connection with server. I want to know how server can authenticate this websocket client, to avoid accepting websocket connections from un-authorized clients(say, java client). 回答1: Assuming you have setup the embedded jetty properly, it

leaflet - count number of requests sent by leaflet to osm (openstreetmap)

你。 提交于 2019-12-24 07:22:05
问题 I'm using leaflet.js for a project. Leaflet sends requests to open street map (osm) tile server to get its tiles. As these requests are sent directly from the client, I have a hard time finding about the requests on my server. Question: Is there a way to find out the number of requests sent by leaflet to the tile servers at osm? (I was not able to find any $.ajax / $.get / $.post in leaflet.js!) 回答1: Please note that $.ajax / $.get / $.post are methods from jQuery. Leaflet does not depend on

Keep a MQTT Client Connection always active

瘦欲@ 提交于 2019-12-24 06:04:18
问题 I am using CloudMQTT as a MQTT broker in my Pub-Sub based application. I am using my publisher to publish data to the CloudMQTT server over a topic , and I plan to subscribe to the broker on my webpage to recieve the transmitted information. I am using this procedure to create a Client (subscriber): https://www.cloudmqtt.com/docs-php.html Code goes as follows: // subscribe.php require("phpMQTT.php"); $host = "hostname"; $port = port; $username = "username"; $password = "password"; $mqtt = new

.Net client authentication setup using HttpWebRequest

ⅰ亾dé卋堺 提交于 2019-12-24 05:44:14
问题 This is more about how to get HttpWebRequest to work or even if HttpWebRequest is the right implementation. I've let my C# and .Net skill lapse the past few year, so I hope I can be forgiven for that. I trying to hit a secure web service that requires client authentication. I have four certs to hit this with. • Root Certificate • Intermediate Root Certificate • Device Certificate • Private Key The server is Java and these certs are in .jks form trustore and keystore. I pulled them into .pem