w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Find machines on local network based on port (network discover) in android
I am assuming you know how to connect to a tcp server. If not, First go through http://examples.javacodegeeks.com/android/core/socket-core/android-socket-example/ You can try opening multiple threads with each thread waiting to connect to a specific ip/port ( along with some timeout value ).If the thread produces an exception, that means the connection was unsuccesful. Othewise add that ip address to your Open_Devices list.

Categories : Java

How can I call a javascript function on client browser from NodeJS server side?
Socket.IO will allow you to establish persistent communication between node.js and front-end JS. You can emit messages and subscribe to any other messages from both sides. As it is bidirectional communication, you dont need any request/response stuff, just emit from any side, and it will be cached by callback on another side.

Categories : Node Js

Setting up local ip over wireless network to create a local server on Ubuntu
Just add this to your normal runserver command: python manage.py runserver 0.0.0.0:8000 Then others on your local network can access it through: http://192.168.1.18:8000

Categories : Django

How do I detect a server host:port on the local network?
You can use the netstat command to find the open ports on a server (windows or linux) example on linux to find a java app server: netstat -anp | grep java Output - it was listening on port 8080: tcp 0 0 10.121.235.200:8080 0.0.0.0:* LISTEN 7051/java And as a side note, you may find this useful, if you have an idea it should be a certain port, you can check if there's a process running that is listening to it by using lsof: lsof -i :portNumber Example: lsof -i :80

Categories : Javascript

Access Virtual WAMP Server on Local Network
Try this: Edit: your httpd.conf file ( use the menus to get to the correct file ) Look for this # onlineoffline tag - don't remove Add a new line AFTER Allow from ...... Like this Allow from 172.16.0.241 Or if you want to be able to see the wampserver from the whole subnet Allow from 172.16.0

Categories : Windows

How do I simulate latency and other network disturbances between client and server on same PC
If you are using windows, it's not quite possible to create some delay in localhost latency. I came up to this issue this winter and that's how I solved a problem. All latency logic will be in your AS3 code. On the moment you receive some data (socket data progress event), you create a new Timer with desired delay (or use an existing one) and pass received socket data with the Timer.COMPLETE event. When your timer fires, you can use it's data like you'd normally do without it - you call some needed functions, you process it and do whatever you need. You can also use setTimeout instead of Timer, it doesn't really matter. You can also add some random packet loss by not creating a Timer, so no data would pass through. And you can also use random Timer time so some packets will be reordered.

Categories : Actionscript

Simple Client-Server application with Blacklist verification by Network
I would do something like this int ip = ip2int(socket.getInetAddress().getHostName()); // iterate over black list, split item into subnet and bits String line = "192.168.1.0/24"; String[] a = line.split("/"); int subnet = ip2int(a[0]); // make a mask int bits = a.length == 1 ? 0 : Integer.parseInt(a[1]); int mask = 0xFFFFFFFF << 32 - bits; // mask client ip and compare if ((ip & mask) == subnet) { // match } this is ip -> int func int ip2int(String ip) throws UnknownHostException { InetAddress a = InetAddress.getByName(ip); return new BigInteger(a.getAddress()).intValue(); }

Categories : Java

Client-server application between two computers in the same network (using boost::asio)
The issue is most likely your home network, not your program. Assuming both your PC and your laptop are both connected to the same router (PC via ethernet and laptop via wireless), any traffic generated by either machine is being sent to the router first. When the this traffic gets to the router, it's most likely doing network address translation (NAT), and then sending the traffic into the internet. If this is the case, the requests from your client may be getting sent into the larger internet (where the internal IP address you're sending requests to is not found / not running the service you expect on the given port), rather than being forwarded to the server running in your local network. To test this hypothesis, run a traceroute from the client using the IP address / port number the

Categories : C++

Android best method to send files from client to server when network is not stable
You should check network failure test cases.When network is failure while data transfering , you should maintain the list of items which is not sent.When network is connected,then try to send remaining items.

Categories : Java

Send a Jpeg file from an Android phone to server station via a local network
It all depends how you expect the image on server side ... There you can expect to receive the data as Post body (array of bytes) or multipart (pretty much as the other one). This is for Http. Some links for these: An Http Post example sending a byte-array. Here's how you can convert a Bitmap to a byte-array. Send the Bitmap through a multi-part Post request. A simple example here, here or here. Haven't looked too much into details on each one, but the implementation is straigh-forward. Sending through socket or ftp is all about opening a connection, get the output stream and send the converted byte-array on that stream ...

Categories : Android

How can I create/install a SSL Cert for a standalone Datasnap Rest Server on local network
First purchase an SSL certificate from a provider such as GoDaddy or RapidSSL. When purchasing you specify the domain name that the certificate will represent. Obviously you can point the domain name to any IP address you wish by configuring the DNS entries for your domain. I've never configured a certificate to point to an actual IP address but I guess it's possible. Given you want to have your server accept requests from the internet, I would use a domain name so that you can change the IP address if required. When purchasing your SSL certificate, you will need to provide a Certificate Signing Request (CSR) which you generate on your server computer, specifying the domain name you want to use the SSL certificate for. You can use a utility such as the DigiCert util (www.digicert.com

Categories : Delphi

How to get Local IP address and proxy server of client
It's entirely up to the proxy as to whether or not it will send the http_x_forwarded_for header. Some will and some won't. Whichever proxy you were using when you printed the $_SERVER variable, hasn't send the header. Even if all proxies did send the header, you would still have a problem because anyone can spoof the http_x_forwarded_for header and so if your script treats that as the real IP, then someone could spoof it to circumvent your IP check. The best you can do if use $_SERVER['REMOTE_ADDR'] and forget about relying on http_x_forwarded_for. Yes users of proxies will be able to visit your site under a new IP, but this is better than the ability for all users to spoof the IP in http_x_forwarded_for. As an aid you could maintain a list of known proxies but again this won't ultimate

Categories : PHP

Is it possible to know if the client (browser) is running on the same machine as the server?
I guess you can check whether the ip address of the request is the same as server's or if it's coming from localhost? I guess this can help: String getRemoteIP(HttpServletRequest request) { String xff = request.getHeader("X-Forwarded-For"); if (xff != null) { return xff.split("[\s,]+")[0]; } return request.getRemoteAddr(); } Compare this address to server's. I took this code from here

Categories : Java

Simple client server program with local IP address
With Android and sockets you need to watch out for a few things Android needs to be the client, since its IP address is expected to change more frequently than that of the server The port number you use should be > 1024 If on a emulator, you need to be aware that the emulator's IP is 10.something. Look up the Android documentation. Permissions in the manifest Lastly, your issue is that you are running a network api in the main UI thread. You need to run the same in a Async task. Thats why you are getting the StrictMode exception thingy. Edit : As for the ping, check if you can ping to your network router. And if you can ping to the outside world then your issue is that your router is blocking the ping inside.

Categories : Java

How do i uniquely identify a browser (or client) whenever it's connected to server
You can identify each socket using it's unique id: socket.id Perhaps you can do something like this to stop everyone except the first socket from broadcasting. var firstClient; io.sockets.on('connection', function(socket) { if(!firstClient){ firstClient = socket.id; } socket.emit('news', "Hello, welcome to our conversation!<br />"); socket.on('receive', function(data) { if(socket.id!==firstClient){ return; // not the first client, so not allowed to broadcast. } //log it to console console.log(data.data); // announce to all clients that someone sent you data. socket.broadcast.emit('news', "Client says: " + data.data + "<br />"); }); });

Categories : Node Js

InApp Browser phoneGap for IOS will not load pages from a local server
I think you are missing semicolon (;) at the end of the window.open if it is written by mistake then try the below code <html> <head> <script> var ref=null; function iabLoadStart(event) { console.log(event.type + ' - ' + event.url); } function iabLoadStop(event) { console.log(event.type + ' - ' + event.url); } function iabClose(event) { console.log(event.type); ref.removeEventListener('loadstart', iabLoadStart); ref.removeEventListener('loadstop', iabLoadStop); ref.removeEventListener('exit', iabClose); } function open_win() { ref=window.open(encodeURI("<inserturlhere>"),'_blank', 'location=no'); ref.addEventListener('loadstart', iabLoad

Categories : Cordova

Is there any network tab with ie8 developer tool? If not then how to track network traffic in ie8 browser?
Internet Explorer 8 doesn't support network statistics in its developer tools. You'll need to upgrade to Internet Explorer 9 or use a third-party tool like Fiddler to inspect traffic.

Categories : Misc

Refreshing client browser window after new build is pushed on server
I see following options: The easiest way is to add client side script which will periodically check version of your web page. Of course you can build more complicated solution for example using SingnalR, in which you could push such method to client. And the last one: store such version in session cookie or add custom header. Verify it on every request.

Categories : Javascript

JavaScript is enabled in client browser in django or in python?
Unfortunately, you can't do this unless trying a second request. There's no way to know this before actually interacting with the browser itself. The closest I can think of is trying to set a cookie and store this information for future visits. Hope it helps.

Categories : Javascript

HybridAuth working within local network, but not when accessed outside of my network
I don't think that most of the OAuth2 providers will accept answers that are not coming from configured callback url. So making redirects with the register will most likely fail. Instead, try to configure your callback to look like: http://www.yourdomain.com:openPort/hybridauth-2.1.2/hybridauth/index.php Where openPort is a port number that your ISP will not block. Then in the router you can make port forwarding openPort->80 or you just can start your web server to openPort and make sure the router is not blocking the requests.

Categories : PHP

Is there a node.js (server) compatible ZLIB.deflate implementation for the browser (client)
Actually there is a solution that works perfectly and is also lightning fast: https://github.com/imaya/zlib.js/blob/develop/README.en.md

Categories : Javascript

Java Script get data from server (asp.net) and save it in local storage (client side)
You are trying to throw in an object into localStorage Change localStorage.setObject("teamworkGantDemo", prj); to localStorage.setItem("teamworkGantDemo", JSON.stringify(prj)); or simply localStorage["teamworkGantDemo"] = JSON.stringify(prj) But if you are insistent on using a wrapper around this, you could do this : Storage.prototype.setObject = function(key, value) { this.setItem(key, JSON.stringify(value)); } Storage.prototype.getObject = function(key) { return JSON.parse(this.getItem(key)); } Then use it this way : localStorage.setObject("teamworkGantDemo", prj);

Categories : Javascript

Read AND write ID3 tags to local files with javascript/jQuery via browser?
You can only read tags.See link below http://ericbidelman.tumblr.com/post/8343485440/reading-mp3-id3-tags-in-javascript

Categories : Javascript

Newly entered Data lost in C#.net when server connection has lost on local network
Check the code and accepted answer to the following question. It might give you a better solution to what you want to achieve In C# what is the best way to determine if a database is up and running?

Categories : C#

Client-Server Program: Client can connect to server easily but server can't respond cause target machine actively refuses connections
You need to design your client and server so that the client-to-server connection remains open to recieve the responce and then do something like this: public static bool sendTo(IPEndPoint ip, String data) { TcpClient client = null; NetworkStream stream = null; StreamWriter writer = null; StreamReader reader = null; try { client = new TcpClient(); client.Connect(ip); stream = c.GetStream(); writer = new StreamWriter(stream); writer.WriteLine(data); writer.Flush(); reader = new StreamReader(stream); string response = reader.ReadLine(); if (response == "roger-alpha-tango") { return true; } } catch { return false; } finally { i

Categories : C#

Sharing local user's profile picture with others in WinRT in local network game
You could directly read the IStorageFile returned by GetAccountPicture: var file = UserInformation.GetAccountPicture(AccountPictureKind.LargeImage); var buffer = await FileIO.ReadBufferAsync(file); var bytes = buffer.ToArray();

Categories : C#

Hosting local maven repository on Local Area Network
Unfortunately just an apache web server is not sufficient to make your repository available over HTTP. You need additional software, a "repository manager". There is a list of them here: http://maven.apache.org/repository-management.html You can make a repository on the local network available over SSH. Here is how to do that. (1) In the build section of your pom: <!-- Make SSH wagon available.--> <extensions> <extension> <groupId>org.apache.maven.wagon</groupId> <artifactId>wagon-ssh-external</artifactId> </extension> </extensions> (2) In your ${USER_HOME}/.m2/settings.xml (or wherever you configure repository URLs): <repositories> <repository>

Categories : Maven

Javascript .find() not working under all the IE browser
Inspect the dropdown ul element and check if the lis are there, it seems to be a CSS problem, which is very common on IE. Try giving the ul ant its elements a float: left; and a width.

Categories : Javascript

Find server details when connection lost with client
to find remote address of server during connection lost, use this on client side this.notificationProviderClient.InnerDuplexChannel.Faulted += new EventHandler(myHost_Faulted); void myHost_Faulted(object sender, EventArgs e) { IContextChannel channel = sender as IContextChannel; if (channel != null) { var remoteAddrs = a1.RemoteAddress; } }

Categories : Wcf

javascript to find local time respected to the place
You can use the Date object function getTime () { var today=new Date(); var hours = today.getHours() > 12 ? today.getHours() - 12 : today.getHours(); var amORpm = hours > 12 ? "pm" : "am"; var minutes =today.getMinutes(); return hours + ":" + minutes + amORpm; } I don't have time to test this but it should work. Edit: You can't exactly set the time zone with JavaScript. However, there are ways around it with some more JavaScript. I suggest looking into the moment.js library. I believe it allows you to do what I want. You can also just use a Server Based Language such as PHP or ASP.NET.

Categories : Javascript

JavaScript: from server to client
Ok. Let me try and explain this in my own words. As far as I understood your problem, you do not want to include all the JS libraries in your code and would rather have the data passed to the JS libraries and then the inbuilt functions within your libraries process your data and return processed output. I have not heard of this being done. Maybe it is so we can wait for an answer regarding that. But ideally what you would do is create a "Web service". So this "Web service" basically act's like your "external javascript function". You pass data to the Web service and this data is processed and returned to you. You then process this output and display it the way you like. So simply put, you will have to design a Web service with functions, that act the way your Javascript functions do.

Categories : Javascript

php server/ javascript client ajax
I've tested it and everthing is working fine. You just need to remove $.parseJSON(data); from your JavaScript. Then it would work because jQuery automatically does that for you if you set the data type to JSON. EDIT: If the PHP script is on a different domain you can add the following PHP header to your script: <?php header('Access-Control-Allow-Origin: *'); ?>

Categories : PHP

How do I get Lync Client working if website is on Server and Lync is on local user Environment?
You cannot control a user's Lync client from your server. If you want the user's client to start a call, make a hyperlink with the tel: prefix: <a href="tel:+9900032etc">Click to call</a> When a user clicks this link, the browser invokes the handler for telephone links, which should be the user's Lync client (or skype, or his mobile phone when he is browsing using that).

Categories : C#

How to push a log file from a client to the server using JavaScript
through javascript you can do form.submit() if the form contains a input type file then the file will get uploaded to the corresponding server folder. Else you can also use Ajax to upload file using libraries like http://code.google.com/p/upload-at-click/ Best solution will be using the FileReader API

Categories : Javascript

How can I get my javascript gererated data from the client to the server via PHP
If you could have the data in a JSON array. Then on the php side use json_decode to pull the data in as an array loop through it and do your updates and inserts for your data in MySQL. http://php.net/manual/en/book.json.php

Categories : PHP

Client - Server program: send string from client to server and received respond
As the server, just write back into the very same NetworkStream you read the string from! On the client side - nothing different - read freom the NetworkStream you just wrote the string to. Your NetworkStream objects should simply work in both directions ;)

Categories : C#

Socket Communication between Java server on client and Javascript
You're kind of on a dirt road and you need to get yourself on a freeway. javascript can communicate to java code in the specific case where the browser got the web page and javascript from a host and then the javascript connects back to that same host to get a connection for more data. In your case, you'd like the same machine to be both client and server. But it is easier to understand what's required if you realize this idea of two machines: a client running the browser and the server which runs java. So, you can find many examples of this on the web. For example, take a look at java running in Tomcat, providing a web page and javascript and then the javascript reading json data using a different URL on the Tomcat server. If you think of the main-stream uses of web technology you

Categories : Java

Javascript scroller works on local server but not online (jsScroller.js)
I can see this error in my console when i opened the link Uncaught ReferenceError: jsScroller is not defined that means that you have not included the js file or your path to js file is wrong. correct that it will surely work.

Categories : Javascript

Can Intellij debug javascript code served by a local web server
Sure you can - you need using the JavaScript Remote debug configuration, set your 'http://localhost:50036/src/index.html' as 'URL to open' and specify remote URL mapping for your project folder (usually it's your web server root url + web path on server) See http://wiki.jetbrains.net/intellij/Remote_JavaScript_debugging_with_WebStorm_and_PHPStorm#Installing_and_configuring_Apache_Web_server for more info Note that as of WebStorm 7 there is only one run configuration for JS debugging, and the run configuration created from right-click menu (action "Create/Debug" html file) uses the url on built-in http server instead of file url

Categories : Javascript

java.io.StreamCorruptedException: invalid type code: AC client server-Can't find multiple instance of ObjectOutputStream
Unless the FileHandler.run()method is synchronized, or there is internal synchronization within it, neither of which is true, I don't see how you can possibly expect this to work. You're writing to the same ObjectOutputStream from multiple threads: you're going to get interleaving of data. Anything could happen at the receiver. NB testing isConnected() doesn't accomplish anything useful. You did connect the Socket, when you created it, and isConnected() will continue to tell you so, even after you close it. It doesn't for example tell you whether the connection is still alive.

Categories : Java



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.