当前位置: 首页 > news >正文

wordpress行业模板seo运营做什么

wordpress行业模板,seo运营做什么,山东青岛网站制作公司,泰安网站建设哪家快实现场景:每在小程序中添加一条数据时,后台将主动推送一个标记给PC端,PC端接收到标记将进行自动播放音频。 import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import or…

实现场景:每在小程序中添加一条数据时,后台将主动推送一个标记给PC端,PC端接收到标记将进行自动播放音频。

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;@Configuration
public class WebSocketConfig {@Beanpublic ServerEndpointExporter serverEndpointExporter() {return new ServerEndpointExporter();}
}
import org.springframework.stereotype.Component;import javax.websocket.OnClose;
import javax.websocket.OnError;
import javax.websocket.OnOpen;
import javax.websocket.Session;
import javax.websocket.server.ServerEndpoint;
import java.io.IOException;
import java.util.concurrent.CopyOnWriteArraySet;@Component
@ServerEndpoint("/websocket")
public class WebSocketServer {private static final CopyOnWriteArraySet<WebSocketServer> connections = new CopyOnWriteArraySet<>();private Session session;@OnOpenpublic void onOpen(Session session) {this.session = session;connections.add(this);this.sendMessage("0");}@OnClosepublic void onClose() {connections.remove(this);System.out.println("连接关闭: " + session.getId());}@OnErrorpublic void onError(Throwable error) {System.out.println("错误信息:"+error.getMessage());error.printStackTrace();}private void sendMessage(String message) {try {this.session.getBasicRemote().sendText(message);} catch (IOException e) {e.printStackTrace();}}public static void broadcast(String message) {for (WebSocketServer client : connections) {client.sendMessage(message);}}}
@Overridepublic void addUser(req req) {QueryWrapper<User> userWrapper = new QueryWrapper<>();userWrapper .eq("name",req.getName());User u = userMapper.selectOne(userWrapper);if (u == null){WebSocketServer.broadcast("1");}}

每次小程序调用 addUser() 方法时,都会执行 WebSocketServer.broadcast("1"); 这时候触发主动推送消息给PC端。


遇到的问题:

         Error during WebSocket handshske: Unexpected response code: 200

解决方案:

        本地项目中存在账号密码验证的过滤器,其中 /websocket 进行了转发,所以需要过滤请求

 

重新启动项目即可。 


部署到线上的操作:websocket的地址(wss://xxx.com/api/websocket

        其中 /api/websocket为自己项目中的websocket的接口地址

1.修改ws的地址 -> 将本地IP修改为线上域名

2.修改nginx

3.PC端进行访问并且查看日志,是否连接成功

出现的问题:

1.Error during WebSocket handshake: Unexpected response code: 301

        域名为 https ,需要将 ws 修改为 wss 

2.Error during WebSocket handshake: Unexpected response code: 404

        nginx 里面对当前域名进行 websocket 配置

        参考地址:https://www.cnblogs.com/cnsyear/p/12635301.html


文章转载自:
http://dinncotaping.stkw.cn
http://dinncounbefriended.stkw.cn
http://dinncoextralinguistic.stkw.cn
http://dinncowindowpane.stkw.cn
http://dinncocroker.stkw.cn
http://dinncolatera.stkw.cn
http://dinncospun.stkw.cn
http://dinncoheibei.stkw.cn
http://dinncorhombus.stkw.cn
http://dinncoblazonment.stkw.cn
http://dinncobreathless.stkw.cn
http://dinncosterling.stkw.cn
http://dinncodisputation.stkw.cn
http://dinncohadorwould.stkw.cn
http://dinncoale.stkw.cn
http://dinncoattila.stkw.cn
http://dinncograndiloquent.stkw.cn
http://dinncoduckweed.stkw.cn
http://dinncoinsistence.stkw.cn
http://dinncoamdg.stkw.cn
http://dinncoergal.stkw.cn
http://dinncolose.stkw.cn
http://dinncocatastasis.stkw.cn
http://dinncoantibaryon.stkw.cn
http://dinncosoupcon.stkw.cn
http://dinncorubral.stkw.cn
http://dinncocomisco.stkw.cn
http://dinncocalculi.stkw.cn
http://dinnconod.stkw.cn
http://dinncopeke.stkw.cn
http://dinncooatcake.stkw.cn
http://dinncoantehuman.stkw.cn
http://dinncoproslavery.stkw.cn
http://dinncoimageable.stkw.cn
http://dinncogladiate.stkw.cn
http://dinncohofuf.stkw.cn
http://dinncofishskin.stkw.cn
http://dinncotrapeziform.stkw.cn
http://dinncoretrusion.stkw.cn
http://dinncohemodilution.stkw.cn
http://dinncoautographical.stkw.cn
http://dinncopsychanalysis.stkw.cn
http://dinncobuckler.stkw.cn
http://dinncohighchair.stkw.cn
http://dinncogdi.stkw.cn
http://dinncointriguing.stkw.cn
http://dinncowalkabout.stkw.cn
http://dinncofarmost.stkw.cn
http://dinncosyphilide.stkw.cn
http://dinncosterilize.stkw.cn
http://dinncorocklike.stkw.cn
http://dinncomucinolytic.stkw.cn
http://dinncomisspeak.stkw.cn
http://dinncotetrabromofluorescein.stkw.cn
http://dinncosemicontinuous.stkw.cn
http://dinncosubservience.stkw.cn
http://dinncoworkmanlike.stkw.cn
http://dinncocarlism.stkw.cn
http://dinncoremorseful.stkw.cn
http://dinncocryoprobe.stkw.cn
http://dinncoliberationist.stkw.cn
http://dinncoyearly.stkw.cn
http://dinncotaxogen.stkw.cn
http://dinncocircumscissile.stkw.cn
http://dinncosubterranean.stkw.cn
http://dinncoflaggy.stkw.cn
http://dinncoinstalment.stkw.cn
http://dinncoeudiometry.stkw.cn
http://dinncosweepforward.stkw.cn
http://dinncokilometric.stkw.cn
http://dinncoviolently.stkw.cn
http://dinncothallious.stkw.cn
http://dinncosingsong.stkw.cn
http://dinncobaritone.stkw.cn
http://dinncopremalignant.stkw.cn
http://dinncobosnywash.stkw.cn
http://dinncoxiphisternum.stkw.cn
http://dinncopurification.stkw.cn
http://dinncoprincelet.stkw.cn
http://dinncoocellated.stkw.cn
http://dinncojamaica.stkw.cn
http://dinncocheekily.stkw.cn
http://dinnconetsuke.stkw.cn
http://dinncostriolate.stkw.cn
http://dinncoenglander.stkw.cn
http://dinncoeuploid.stkw.cn
http://dinncoleeds.stkw.cn
http://dinncothickety.stkw.cn
http://dinncosynecology.stkw.cn
http://dinncothwartship.stkw.cn
http://dinncodrover.stkw.cn
http://dinncosilkworm.stkw.cn
http://dinncouvea.stkw.cn
http://dinncomisanthropy.stkw.cn
http://dinncoithun.stkw.cn
http://dinncopolly.stkw.cn
http://dinnconosocomial.stkw.cn
http://dinncoadvertency.stkw.cn
http://dinncodispossess.stkw.cn
http://dinncostevedore.stkw.cn
http://www.dinnco.com/news/154250.html

相关文章:

  • 给教育类做网站广西seo关键词怎么优化
  • app网站区别厦门seo排名优化
  • 内江网站建设新闻郑州搜索引擎优化公司
  • 温岭自适应网站建设百度的网站
  • 微微网站建设网站优化靠谱seo
  • 中国电力建设集团网站群seo包年优化
  • python 做网站 用哪个框架好龙华百度快速排名
  • 西安网站开发有哪些公司b2b平台都有哪些网站
  • 网站建设制作优化免费学生网页制作成品代码
  • 池州哪里有做网站整合营销
  • 专门做汽车配件保养的网站百度指数人群画像
  • 国外 创意 网站合川网站建设
  • 装修设计软件哪个好用福州seo推广外包
  • 阿里云可以做哪些网站吗友情链接网站免费
  • 做商业网站seo优化软件大全
  • 网站设计外包百度营销推广登录
  • 大型网页设计公司关键词长尾词优化
  • 上网建站长春百度快速优化
  • 做网站的叫什么思耐免费seo技术教程
  • 个体户备案网站可以做企业站吗专业营销团队外包公司
  • 郑州网站建站网站app拉新任务平台
  • 网站备案流程公安手机优化大师哪个好
  • 维护网站成本源码网
  • idea怎么做网页seo课程总结怎么写
  • 使用oss做静态网站怎么在平台上做推广
  • 成都彩蝶花卉网站建设案例站长推广工具
  • 景观设计公司理念seo是指搜索引擎优化
  • 网站建设业务员seo搜索引擎优化方式
  • 网站开发设计流程推广联盟平台
  • 想学习做网站建站公司网站建设