首页 文章 精选 留言 我的

精选列表

搜索[MaaS平台],共10000篇文章
优秀的个人博客,低调大师

区分不同手机平台客户端

Conclusion:Unlike User-Agent ,which let the browser describe its meta data and information , the two kinds of client by default will not have a pre-defined field which can function like this. Solution:(We created aself-defined fieldin the http header) For example ,we create a field namedMobile-Agent In client side: when we construct the http request ,we add the value of header “Mobile-Agent” to be some value Android Client codeonly need to set the “Mobile-Agent” header to be ”Android”. Code example: (see myhighlighted) publicJSONObjectcallJSONWebService(Stringurl){ HttpParamsmy_httpParams=newBasicHttpParams(); HttpConnectionParams.setConnectionTimeout(my_httpParams,conn_timeout); HttpConnectionParams.setSoTimeout(my_httpParams,conn_timeout); HttpClienthttpClient=newDefaultHttpClient(my_httpParams); HttpGethttpRequest=newHttpGet(url); httpRequest.setHeader("User-Agent","bleumagent"); httpRequest.setHeader(“Mobile-Agent”,”Android”); HttpResponsehttpResponse=null; JSONObjecthttpJsonResult=null; Stringresult=null; try{ httpResponse=httpClient.execute(httpRequest); if(httpResponse.getStatusLine().getStatusCode()==200){ HttpEntityhttpEntity=httpResponse.getEntity(); if(httpEntity!=null){ InputStreaminputStream=httpEntity.getContent(); result=this.convertStreamToString(inputStream); httpJsonResult=newJSONObject(result); inputStream.close(); } } }catch(Exceptione){ System.out.println("callJsonWebServicefailed."); e.printStackTrace(); } httpClient.getConnectionManager().shutdown(); returnhttpJsonResult; } IPhoneClient codecan use Objective-C to do the similar thing ,just set the “Mobile-Agent” header to be “IPhone” In server side’s servlet : we only use the Servlet API to resolve “Mobile-Agent” field. Then solved. 本文转自 charles_wang888 51CTO博客,原文链接:http://blog.51cto.com/supercharles888/835904,如需转载请自行联系原作者

优秀的个人博客,低调大师

Nginx+Keepalived高可用架构平台

前言*随着Nginx在国内的发展潮流,越来越多的互联网公司都在使用Nginx。 Nginx高性能、稳定性成为IT人士青睐的http和反向代理服务器。今天我们来一起来温习一下Nginx+Keepalived高可用配置,鉴于互联网类似的优秀文章很多,这里仅供参考和交流。 一、实验环境: 系统环境:CentOS 6.0 x86_64 Nginx版本:nginx v1.2.4 Keepalived版本:keepalived v1.2.1 Nginx-1:192.9.117.160(Master) Nginx-2:192.9.117.161(Backup) 二、Nginx安装配置: 三、Keepalived安装配置: Nginx、Keepalived软件安装完毕,接下来进行详细配置。 四、配置Keepalived: 两台服务器端keepalived.conf内容都为如下,都设置为backup,不抢占,注意修改优先级不同: 如上配置,我们需要自己建立check_nginx脚本,以方便检查本地Nginx是否存活更好的切换。Check_nginx.sh脚本内容如下: 五、Nginx配置: 在两台Nginx服务器分别新建index.html测试页面,然后启动Nginx服务测试。 访问VIPhttp://192.9.117.162如下: Down掉192.9.117.160的Nginx服务,分别查看keepalived后台日志和ping VIP日志如下: Oct 16 16:47:48 localhost Keepalived: Stopping Keepalived v1.2.1 (10/16,2012) Oct 16 16:47:49 localhost Keepalived_vrrp: Terminating VRRP child process on signal 至此,Nginx+Keepalived高可用WEB架构搭建成功!目前此套系统已经在线上使用,后期会观察使用情况并分享给大家,欢迎多交流! 本文转自 wgkgood 51CTO博客,原文链接:http://blog.51cto.com/wgkgood/1028529

资源下载

更多资源
优质分享App

优质分享App

近一个月的开发和优化,本站点的第一个app全新上线。该app采用极致压缩,本体才4.36MB。系统里面做了大量数据访问、缓存优化。方便用户在手机上查看文章。后续会推出HarmonyOS的适配版本。

腾讯云软件源

腾讯云软件源

为解决软件依赖安装时官方源访问速度慢的问题,腾讯云为一些软件搭建了缓存服务。您可以通过使用腾讯云软件源站来提升依赖包的安装速度。为了方便用户自由搭建服务架构,目前腾讯云软件源站支持公网访问和内网访问。

Nacos

Nacos

Nacos /nɑ:kəʊs/ 是 Dynamic Naming and Configuration Service 的首字母简称,一个易于构建 AI Agent 应用的动态服务发现、配置管理和AI智能体管理平台。Nacos 致力于帮助您发现、配置和管理微服务及AI智能体应用。Nacos 提供了一组简单易用的特性集,帮助您快速实现动态服务发现、服务配置、服务元数据、流量管理。Nacos 帮助您更敏捷和容易地构建、交付和管理微服务平台。

Sublime Text

Sublime Text

Sublime Text具有漂亮的用户界面和强大的功能,例如代码缩略图,Python的插件,代码段等。还可自定义键绑定,菜单和工具栏。Sublime Text 的主要功能包括:拼写检查,书签,完整的 Python API , Goto 功能,即时项目切换,多选择,多窗口等等。Sublime Text 是一个跨平台的编辑器,同时支持Windows、Linux、Mac OS X等操作系统。

用户登录
用户注册
修改密码
忘记密码