windows server 2008 websocket

windows Server 2008 上IIS为7.5 ,现在要IIS8.0才有支持WebSocket,请问有没有什么办法?

2个回答

微软官方不支持,这个没办法。也许你可以使用asp.net自托管的方式运行程序,甩掉iis。不过我没在生产环境这么做过。

实在不行,就用iis8.0

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
WebsocketServer:将事件消息发送到连接的客户端

<div class="post-text" itemprop="text"> <p>Problem is simple: i have WS server that doing it's "for {}". I need "register" connected user, then send message on event(outside of CoreWS function). I'm added NodeJS example that doing exactly what i need, for better understanding.</p> <p>Go Lang Code that fails: i'm using this pkg <a href="https://github.com/gobwas/ws" rel="nofollow noreferrer">https://github.com/gobwas/ws</a></p> <pre><code>var conn_itf interface{} //yeah, var op_itf interface{} //i know it's not how it works func main() { go collector() go sender() http.ListenAndServe(":3333", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { conn, _, _, err := ws.UpgradeHTTP(r, w) if err != nil { // handle error } go func() { defer conn.Close() for { msg, op, err := wsutil.ReadClientData(conn) conn_itf = conn // i'm trying to "register" user op_itf = op if err != nil { } err = wsutil.WriteServerMessage(conn, op, msg) if err != nil { } } }() })) } func collector() { for { fmt.Println("conn: ", conn_itf) fmt.Println("op: ", op_itf) time.Sleep(10000 * time.Millisecond) } } func sender() { for { msg := []byte("Hello world!") time.Sleep(50000 * time.Millisecond) wsutil.WriteServerMessage(conn_itf, op_itf, msg) //invoking ws-send } } </code></pre> <p>NodeJS that working:</p> <pre><code>const wss = new WebSocket.Server({ port: 3333 }) wss.on('connection', ws =&gt; { sockets.set('key', ws) //this code remember active connection ws.on('message', message =&gt; { console.log(`Received message =&gt; ${message}`) }) }) function callsend(data) { const ws = sockets.get('key') //this code sending message on invoking ws.send(data) } </code></pre> </div>

com.jacob包 在Windows10开发环境运行正常,在Windows server 2008 抛出异常

com.jacob.com.ComFailException: Invoke of: AudioOutputStream Source: Description: at com.jacob.com.Dispatch.invokev(Native Method) at com.jacob.com.Dispatch.invokev(Dispatch.java:625) at com.jacob.com.Dispatch.invoke(Dispatch.java:498) at com.jacob.com.Dispatch.putRef(Dispatch.java:819) at net.bjnblh.dc.textToSpeech.service.MSTTSSpeech.saveToWav(MSTTSSpeech.java:274) at net.bjnblh.dc.textToSpeech.service.impl.NoteReadingServiceImpl.makeWavAndReturnUrl(NoteReadingServiceImpl.java:70) at net.bjnblh.dc.textToSpeech.service.impl.NoteReadingServiceImpl.docToHtml(NoteReadingServiceImpl.java:53) at net.bjnblh.dc.textToSpeech.service.impl.NoteReadingServiceImpl$$FastClassBySpringCGLIB$$9c509776.invoke(<generated>) at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:720) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) at com.alibaba.druid.support.spring.stat.DruidStatInterceptor.invoke(DruidStatInterceptor.java:72) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:655) at net.bjnblh.dc.textToSpeech.service.impl.NoteReadingServiceImpl$$EnhancerBySpringCGLIB$$62d6289f.docToHtml(<generated>) at net.bjnblh.dc.textToSpeech.controller.noteReadingController.getHtmlByWord(noteReadingController.java:40) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:136) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:832) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:743) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:961) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:895) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:967) at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:869) at javax.servlet.http.HttpServlet.service(HttpServlet.java:648) at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:843) at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66) at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:346) at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:262) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at net.bjnblh.dc.core.filter.CrossFilter.doFilter(CrossFilter.java:37) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:240) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:212) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:94) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:504) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:141) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:88) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:502) at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1132) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:684) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1533) at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1489) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) at java.lang.Thread.run(Thread.java:745) ``` public void saveToWav(String text, String filePath) { // 创建输出文件流对象 ax=new ActiveXComponent("Sapi.SpFileStream"); spFileStream=ax.getObject(); // 创建音频流格式对象 if(spAudioFormat==null) { ax=new ActiveXComponent("Sapi.SpAudioFormat"); spAudioFormat=ax.getObject(); } // 设置音频流格式类型 Dispatch.put(spAudioFormat,"Type",new Variant(this.formatType)); // 设置文件输出流的格式 Dispatch.putRef(spFileStream,"Format",spAudioFormat); // 调用输出文件流对象的打开方法,创建一个.wav文件 Dispatch.call(spFileStream,"Open",new Variant(filePath),new Variant(3),new Variant(true)); // 设置声音对象的音频输出流为输出文件流对象 Dispatch.putRef(spVoice,"AudioOutputStream",spFileStream); // 调整音量和读的速度 Dispatch.put(spVoice,"Volume",new Variant(this.volume));// 设置音量 Dispatch.put(spVoice,"Rate",new Variant(this.rate));// 设置速率 // 开始朗读 Dispatch.call(spVoice,"Speak",new Variant(text)); /* 分一句话去读 Long initTime =System.currentTimeMillis(); for (Element element:elements) { String text =element.childNode(0).toString(); String[] strings= text.split("\\p{P}"); String newNodeHtml =""; for (int n=0 ; n<strings.length;n++) { String start=String.valueOf(System.currentTimeMillis() - initTime); System.out.println(start); Dispatch.call(spVoice,"Speak",new Variant(strings[n])); newNodeHtml += "<span id=" +start+ ">" + strings[n] +"</span>"; } listValue.add(newNodeHtml); }*/ // 关闭输出文件流对象,释放资源 Dispatch.call(spFileStream,"Close"); Dispatch.putRef(spVoice,"AudioOutputStream",null);//此处异常 } ```

从websocket收到消息时,不会导致“ Websocket:关闭1011”

<div class="post-text" itemprop="text"> <p>I'm trying to subscribe to an event from a client to a server. I can subscribe to the event using JavaScript but when I use <code>Golang</code> and the <code>Gorilla Websocket library</code> I get a</p> <blockquote> <p>'websocket: close 1011 (internal server error)'</p> </blockquote> <p>every time I start a read from the socket.</p> <p>I tried using the <code>/x/websocket</code> library as well but when I tried to read from the socket I end up hanging and I dont get the '1011' error.</p> <p>If I use this JavaScript code on my browser it works:</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;/head&gt; &lt;body&gt; &lt;script&gt; var socket = new WebSocket("ws://blehip:blehpport"); function send(data) { socket.send(JSON.stringify(data)); } socket.onopen = function() { send({ action: 'subscribe', auth_token: 'Bleh', request_id: 'Bleh', data: { account_id: 'bleh', binding: "bleh" } }); } socket.onmessage = function(raw_message) { var json_data = JSON.parse(raw_message.data); console.log(json_data); }; &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>I get a stream of JSON objects in real time.</p> <p>This is my small Golang, Gorilla/Websockets script</p> <pre><code>func main() { var server = flag.String("server", "blehIP:BlehPort", "server address") var wg sync.WaitGroup flag.Parse() url := url.URL { Scheme: "ws", Host: *server, Path: "", } conn, _, err := websocket.DefaultDialer.Dial(url.String(), nil) if err != nil { log.Fatal("Dial Error: ", err) } defer conn.Close() payload := []byte(`{"action":"subscribe",`+ `"auth_token":"` + bleh + `",`+ `"request_id":"` + bleh + `",`+ `"data": {`+ `"account_id":"` + bleh + `",`+ `"binding":"` + bleh + `"}`+ `}`) wg.Add(1) go func() { defer conn.Close() defer wg.Done() err = conn.WriteMessage(websocket.TextMessage, payload) if err != nil { log.Println("Write Error: ", err) return } m := frame{} err := conn.ReadJSON(&amp;m) if err != nil { log.Println("WebScoket closed.", err) return } // msg := string(bytes[:]) fmt.Printf("%v", m) }() wg.Wait() return } </code></pre> <blockquote> <p>The error returned is: WebSocket closed. websocket: close 1011 (internal server error)</p> </blockquote> </div>

大神求救!~windows Server 2012R2服务器出错~

![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/9.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/9.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/9.gif)昨天配置服务器IIS的时候不小心把里面的所有角色功能都删除了。重启后桌面什么都没有了。。。只能打开任务管理器了![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/9.gif)![图片说明](http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/9.gif)救命。。

window server2012,软件无法请求到数据

安装了IIS,重启服务器之后,软件无法请求到数据,提示bad gateway,怎么解决?服务器是在阿里云上。![图片说明](http://img.bbs.csdn.net/upload/201608/10/1470818268_11607.png)![图片说明](http://img.bbs.csdn.net/upload/201608/10/1470818275_480268.png)![图片说明](http://img.bbs.csdn.net/upload/201608/10/1470818280_854165.png)

windows下使用novnc远程桌面,nginx怎么使用?

想在项目上使用novnc远程桌面,被控电脑已经安装了vnc server。项目是在iis上,因为:浏览器不支持VNC,所以不能直接连接VNC,但是可以使用代理,使用noVNC通过WebSocket建立连接,而VNC Server不支持WebSocket,所以需要开启Websockify代理来做WebSocket和TCP Socket之间的转换。 通过node.js做代理可实现单台远程,使用nginx怎么实现代理?多台代理怎么配置?

django websocket 聊天功能 用nginx代理 访问失败

django 项目 用dwebsocket 实现简单的聊天功能 本地调试已经成功 发布到服务器用nginx做代理, 链接失败 firefox 报错信息: ``` Firefox 无法建立到 ws://xxxxxx/ 服务器的连接。 ``` chrome 报错信息: ``` WebSocket connection to 'ws://xxxxxxx/' failed: Error during WebSocket handshake: Unexpected response code: 400 ``` nginx 配置如下: ``` server { server_name xxxxxxxxxxxxx; listen 80; location /static { root /var/fixpdq; } location /media { root /var/fixpdq; } location / { proxy_pass http://127.0.0.1:8100; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Upgrade $http_upgrade; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Connection "upgrade"; } } ``` django view 代码如下(多余代码省略了) ``` @require_websocket def chat(request): if request.is_websocket(): print('握手成功') .... ``` 本地调试用127.0.0.1 访问是没问题的, 但在本机用局域网ip访问, 就不通, 发布到服务器, 用nginx做代理, 也是不通, 确定的是前端请求已经到达后台代码了. 我想可能是nginx配置的问题 或者是请求到达服务器nginx之前已然就不是socket请求了(因为本机用局域网ip访问也不通), 但是试过很多方法了, 在view 里request.is_websocket() 这句代码是false, nginx转发后居然不是socket请求了, 那肯定就是nginx的配置问题了, 不应该是django 的问题, 求大神帮帮忙!!!

为什么此websocket连接被拒绝?

<div class="post-text" itemprop="text"> <p>I try to use the slack-sample bot from this blogpost <a href="https://www.opsdash.com/blog/slack-bot-in-golang.html" rel="nofollow">https://www.opsdash.com/blog/slack-bot-in-golang.html</a> . I've successfully created my api token, but i can not connect to the websocket server (the rtm.start request passs normally). I've get the error message</p> <blockquote> <pre><code>dial tcp 54.242.95.213:443: connectex: No connection could be made because the target machine actively refused it </code></pre> </blockquote> <p>I've also tried to connect via a chrome app called <strong>Simple Web Socket Client</strong> and via a website based one tester. Both work well, i can establish a connection and i can send data.</p> <p>I'm behind a proxy, but i only have troubles with golang's websocket.Dial function.</p> <p>Does anybody know why this can happen?</p> <p>I use:<br> - Windows 7 SP1 x64<br> - Golang 1.7.1 windows/amd64 </p> <p>Greetings Tonka</p> </div>

在websocket握手上使用会话数据

<div class="post-text" itemprop="text"> <p>If a logged on user navigates to a certain area of the site which is to use WebSockets, How am I to grab that session Id so I can identify him on the server?</p> <p>My server is basically an endless while loop which holds information about all connected users and stuff, so in order to grab that id I figured the only suitable moment is at the handshake, but unfortunately the handshake's request headers contain no cookie data:</p> <blockquote> <p><strong>Request Headers</strong> </p> <p>Accept: text/html,application/xhtml+xml,application/xml;q=0.9,<em>/</em>;q=0.8<br> Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.5<br> Cache-Control: no-cache<br> Connection: keep-alive, Upgrade<br> DNT: 1<br> Host: 192.168.1.2:9300<br> Origin: <code>http://localhost</code><br> Pragma: no-cache<br> Sec-WebSocket-Key: 5C7zarsxeh1kdcAIdjQezg==<br> Sec-WebSocket-Version: 13<br> Upgrade: websocket<br> User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0</p> </blockquote> <p>So how can I really grab that id? I thought I could somehow force javascript to send cookie data along with that request but any self-respecting website in 2014 will have httpOnly session cookies so that wont work out. Any help is greatly appreciated!</p> <p>Here's a download link for the files of the server I'm using <a href="http://www.4shared.com/rar/7RIos1tuce/PHPWebSocket-Chat-master.html" rel="noreferrer">http://www.4shared.com/rar/7RIos1tuce/PHPWebSocket-Chat-master.html</a></p> </div>

关于websocket在spring项目握手失败的问题

用java实现的websocket 我在不适用其他框架的时候可以正常握手访问 但是最近加在一个适用spring的项目中,一直握手不成功,这是什么原因? 以下是浏览器返回的信息 ``` Request URL:ws://127.0.0.1:8080/springDemo/websocket/roomName/roomId Request Method:GET Status Code:404 Not Found Response Headers (5) Request Headers view source Accept-Encoding:gzip, deflate, sdch Accept-Language:zh-CN,zh;q=0.8 Cache-Control:no-cache Connection:Upgrade Cookie:JSESSIONID=1FF3C077231B22FAE14E6CCD5E68FBF6 Host:127.0.0.1:8080 Origin:http://127.0.0.1:8080 Pragma:no-cache Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits Sec-WebSocket-Key:pUvNNKdq1RM3Sl7F0+rIIw== Sec-WebSocket-Version:13 Upgrade:websocket User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.101 Safari/537.36 ``` 我spring配置信息是这样的 ``` <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="classpath:jdbcOracle.properties" /> </bean> <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource"> <property name="driverClass" value="${jdbc.driver}" /> <property name="jdbcUrl" value="${jdbc.url}" /> <property name="user" value="${jdbc.username}" /> <property name="password" value="${jdbc.password}" /> <property name="autoCommitOnClose" value="true" /> <property name="checkoutTimeout" value="${cpool.checkoutTimeout}" /> <property name="initialPoolSize" value="${cpool.minPoolSize}" /> <property name="minPoolSize" value="${cpool.minPoolSize}" /> <property name="maxPoolSize" value="${cpool.maxPoolSize}" /> <property name="maxIdleTime" value="${cpool.maxIdleTime}" /> <property name="acquireIncrement" value="${cpool.acquireIncrement}" /> </bean> <!-- 数据库 事务管理器 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- 创建SqlSessionFactory,同时指定数据源 --> <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="dataSource" ref="dataSource"/> <!-- 自动扫描mapping.xml文件 --> <property name="mapperLocations" > <list> <value>classpath*:com/bs/gpms/**/mapper/*.xml</value> <value>classpath*:com/bs/basic/base/dao/*.xml</value> </list> </property> </bean> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <property name="annotationClass" value="org.springframework.stereotype.Repository"/> <property name="basePackage" value="com.bs.gpms"/> </bean> <!-- <bean id="lobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" /> <bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="configLocation" value="classpath:SqlMapConfig.xml" /> <property name="lobHandler" ref="lobHandler" /> </bean> --> <!-- 基于注释的事务,当注释中发现@Transactional时,使用id为“transactionManager”的事务管理器 --> <!-- 如果没有设置transaction-manager的值,则spring以缺省默认的事务管理器来处理事务,默认事务管理器为第一个加载的事务管理器 --> <tx:annotation-driven transaction-manager="transactionManager"/> <!-- <bean id="sqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate"> <property name="sqlMapClient" ref="sqlMapClient" /> </bean> --> <mvc:annotation-driven> <mvc:message-converters> <bean class="org.springframework.http.converter.StringHttpMessageConverter"> <property name="supportedMediaTypes"> <list> <value>application/json;charset=UTF-8</value> </list> </property> </bean> </mvc:message-converters> </mvc:annotation-driven> <context:annotation-config /> <context:component-scan base-package="com.*" /> <bean id="viewResolver" class="org.springframework.web.servlet.view.UrlBasedViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="prefix" value="/" /> <property name="suffix" value=".jsp" /> </bean> ``` 一直找不到问题,因为这是旧项目,也没办法更新到spring4

Docker Nginx 502 GET / Post请求的网关不正确,但Websocket无效

<div class="post-text" itemprop="text"> <p>There have been various similar cases here on stackoverflow but they're pretty much all refer to incorrect ports or using localhost as the IP instead of the docker-machine ip.</p> <p>The vue.js app connects perfectly fine to the websocket and works. However, the GET requests to <code>192.168.99.100:8080/meows</code> and other endpoints all hit the <code>nginx 502 bad gateway</code>. Manually accessing the endpoints (instead of vue.js) also hit <code>502 bad gateway</code>.</p> <p>The ip's are properly set. Ports are the same everywhere <code>:8080</code>. endpoints have the correct <code>http verb</code>and all have an <code>nginx upstream</code> pointing at the <code>server location /..{}</code>. Yet no problems connecting to the network, all data passing through no problem.</p> <p>EDIT: Im running windows 7 with the docker-toolbox because my windows version doesnt have the whole virtualization thing. No further configuration after installation has been done.</p> <p>The architecture is the following:</p> <p><a href="https://i.stack.imgur.com/NRVxE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/NRVxE.jpg" alt="enter image description here"></a></p> <p>docker-compose</p> <pre><code>version: "3.6" services: meow: build: "." command: "meow-service" depends_on: - "postgres" - "nats" environment: POSTGRES_DB: "meower" POSTGRES_USER: "meower" POSTGRES_PASSWORD: "123456" NATS_ADDRESS: "nats:4222" query: build: "." command: "query-service" depends_on: - "postgres" - "nats" environment: POSTGRES_DB: "meower" POSTGRES_USER: "meower" POSTGRES_PASSWORD: "123456" NATS_ADDRESS: "nats:4222" ELASTICSEARCH_ADDRESS: "elasticsearch:9200" pusher: build: "." command: "pusher-service" depends_on: - "nats" environment: NATS_ADDRESS: "nats:4222" postgres: build: "./postgres" restart: "always" environment: POSTGRES_DB: "meower" POSTGRES_USER: "meower" POSTGRES_PASSWORD: "123456" nats: image: "nats-streaming:0.9.2" restart: "always" elasticsearch: image: 'docker.elastic.co/elasticsearch/elasticsearch:6.2.3' nginx: build: "./nginx" ports: - "8080:80" depends_on: - "meow" - "query" - "pusher" </code></pre> <p>nginx.conf:</p> <pre><code>user nginx; worker_processes 1; events { worker_connections 1024; } http { upstream meows_POST { server meow:8080; } upstream meows_GET { server query:8080; } upstream search_GET { server query:8080; } upstream pusher { server pusher:8080; } server { proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; add_header Access-Control-Allow-Origin *; location /meows { limit_except GET POST OPTIONS { deny all; } proxy_pass http://meows_$request_method; } location /search { limit_except GET OPTIONS { deny all; } proxy_pass http://search_GET; } location /pusher { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_pass http://pusher; } } } </code></pre> <p>And to show that the go application also uses the correct ports, the following is the port listening for </p> <pre><code>func newRouter() (router *mux.Router) { router = mux.NewRouter() router.HandleFunc("/meows", listMeowsHandler). Methods("GET") router.HandleFunc("/search", searchMeowsHandler). Methods("GET") return } router := newRouter() if err := http.ListenAndServe(":8080", router); err != nil { log.Fatal(err) } </code></pre> </div>

Secure WebSocket(wss://)在Firefox上不起作用

<div class="post-text" itemprop="text"> <p>I have a working WebSocket non secure application. But my website uses https and I need a Secure WebSocket connection to avoid Firefox to complain about the fact that the connection is insecure.</p> <p>I am using <a href="http://code.google.com/p/php-websocket-server/">php-websocket-server</a> for my WebSocket server with PhP 5.2.9, so when i use WebSocket secure i can't decrypt packets with the openssl_decrypt function. </p> <p>That's why i used <a href="http://www.stunnel.org/">stunnel</a> in order to decrypt packets sent by the client using wss, to do that i binded client WebSocket to 12345 port an server WebSocket to 54321 port, then i added a stunnel in server mode :</p> <pre><code>[wsServer] accept = 12345 connect = 192.168.1.227:54321 </code></pre> <p>With this configuration my application works fine on Chrome through https + wss. But on Firefox there's a problem during the handshake, it seems that <code>Sec-WebSocket-Version</code> and <code>Sec-WebSocket-Key</code> are missing in the header. I don't understand because it works on Firefox through http + ws.</p> <p>Thanks in advance for your help.</p> <p>Edit : i added an exception for the certificate on the port 12345, now the handshake is going well because i think Firefox now have the <code>Sec-WebSocket-Key</code>.</p> <p>Here the working header request with Firefox (bigger than Chrome request):</p> <pre><code>GET / HTTP/1.1 Host: 192.168.1.227:12345 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20100101 Firefox/14.0.1 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/;q=0.8 Accept-Language: fr,fr-fr;q=0.8,en-us;q=0.5,en;q=0.3 Accept-Encoding: gzip, deflate DNT: 1 Connection: keep-alive, Upgrade Sec-WebSocket-Version: 13 Origin: https://192.168.1.227 Sec-WebSocket-Protocol: HyBi-00 Sec-WebSocket-Key: 65nHN33M6drIPjQHcGK8pA== Pragma: no-cache Cache-Control: no-cache Upgrade: websocket </code></pre> </div>

node.js - 通过websocket发送cookie

<div class="post-text" itemprop="text"> <p>I'm currently using node.js <code>websocket</code> module in my project. There is <code>PHPSESSID</code> in my browser but not in websocket's request header</p> <pre><code> Accept-Encoding:gzip, deflate, sdch Accept-Language:en-US,en;q=0.8,ka;q=0.6,ru;q=0.4 Cache-Control:no-cache Connection:Upgrade Host:someHost Origin:someOrigin Pragma:no-cache Sec-WebSocket-Extensions:permessage-deflate; client_max_window_bits Sec-WebSocket-Key:0Hq9BZfHAxIMbfu3cJpWyg== Sec-WebSocket-Protocol:echo-protocol Sec-WebSocket-Version:13 Upgrade:websocket User-Agent:Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36 </code></pre> <p>I have checked it in my server side code</p> <pre><code> wsServer.on('request', function(request) { console.log(request.cookies); }); </code></pre> <p>and it prints an empty array <code>[]</code>.</p> <p>How can I send cookie via websocket? Should I use headers or something else?</p> </div>

如何获取当前用户组的所有SID

<div class="post-text" itemprop="text"> <p>I need to get all the SIDs of the groups of a current user.</p> <p>I noticed the <a href="https://godoc.org/os/user" rel="nofollow noreferrer"><code>os/user</code></a> package may do this, but I cannot access the functions in <a href="https://golang.org/src/os/user/lookup_windows.go" rel="nofollow noreferrer"><code>lookup_windows.go</code></a>, because the functions are not capitalized, right?</p> <p>How can I get all the SIDs of the groups of the current user?</p> </div>

linux虚拟机与windows间socket通信问题

虚拟机linux服务端 windows客户端 虚拟机桥接模式,能互相ping到,但运行连接不上 linux Server #include<stdio.h> #include<stdlib.h> #include<errno.h> #include<string.h> #include<sys/types.h> #include<sys/socket.h> #include<netinet/in.h> #include<sys/wait.h> #define BACKLOG 5 int main(int arge,char *argv[]) { int sockfd,new_fd; struct sockaddr_in my_addr; struct sockaddr_in their_addr; int sin_size; int data[2]; int sum ; if((sockfd = socket(AF_INET,SOCK_STREAM,0)) == -1) { perror("socket fail"); exit(1); } my_addr.sin_family = AF_INET; my_addr.sin_port = htons(12345); my_addr.sin_addr.s_addr = htonl(INADDR_ANY); bzero(&(my_addr.sin_zero),0); if(bind(sockfd,(struct sockaddr *)&my_addr,sizeof(struct sockaddr)) == -1) { perror("bind fail"); exit(1); } if(listen(sockfd,BACKLOG) ==-1) { perror("listen fail"); exit(1); } while(1) { sin_size = sizeof(struct sockaddr_in); printf("hello\n"); if((new_fd = accept(sockfd,(struct sockaddr *)&their_addr,&sin_size)) == -1) { perror("accept fail"); continue; } printf("Server:got connection from %s\n",inet_ntoa(their_addr.sin_addr)); if(!fork()) { while(1) { if((recv(new_fd,data,sizeof(data),0)) == -1) { printf("recv fail"); break; } sum = data[0] +data[1]; send(new_fd,(const char*)(char*)&sum,sizeof(sum),0); } close(new_fd); exit(0); } } close(new_fd); close(sockfd); return 0; } windows客户端 // Client.cpp : 定义控制台应用程序的入口点。 // //#include "stdafx.h" #include <iostream> #include <winsock.h> #pragma comment(lib, "ws2_32.lib") using namespace std; int main(int argc, char* argv[]) { try { //初始化套接字库 //WSAStartup WORD wVersion = MAKEWORD(2, 2); WSADATA wsaData; if (0 != ::WSAStartup(wVersion, &wsaData)) { throw "WSAStartup fail!"; } if (2 != HIBYTE(wsaData.wVersion) || 2 != LOBYTE(wsaData.wVersion)) { throw "Verify version fail!"; } //创建一个SOCKET //socket SOCKET sock = ::socket(AF_INET, SOCK_STREAM, 0); if (INVALID_SOCKET == sock) { throw "Create socket fail!"; } //初始化一个有效地址(给大堂经理一个胸签) //SOCKADDR_IN SOCKADDR_IN serverAddr; serverAddr.sin_family = AF_INET; serverAddr.sin_port = htons(12345); serverAddr.sin_addr.S_un.S_addr = inet_addr("192.168.1.15"); //连接服务器 if (SOCKET_ERROR == ::connect(sock, (const sockaddr*)&serverAddr, sizeof(serverAddr))) { int iError = ::WSAGetLastError(); cout << "connect fail!" << endl; //::Sleep(5000); } while (1) { int iSendData[2]; cout << "Please input data:" << endl; cin >> iSendData[0] >> iSendData[1]; ::send(sock, (const char*)&iSendData, sizeof(iSendData), 0); //::send(sock, "1111111", sizeof("1111111"), 0); //char szRecvBuf[100]; //::recv(sock, (char*)szRecvBuf, sizeof(szRecvBuf), 0); //接收应答 int iSum = 0; ::recv(sock, (char*)&iSum, sizeof(iSum), 0); cout << iSum <<endl; // cout << szRecvBuf << endl; } ::closesocket(sock); ::WSACleanup(); } catch (char* pStr) { cout << pStr << endl; return -1; } return 0; } ``` 一运行客户端就显示连接失败,求大神解决

ajax在win2003上报500(internal server error)

HTTP Status 500 - Handler processing failed; nested exception is java.lang.UnsupportedClassVersionError: cn/siggy/util/DBUtil type Exception report message Handler processing failed; nested exception is java.lang.UnsupportedClassVersionError: cn/siggy/util/DBUtil description The server encountered an internal error that prevented it from fulfilling this request. exception org.springframework.web.util.NestedServletException: Handler processing failed; nested exception is java.lang.UnsupportedClassVersionError: cn/siggy/util/DBUtil org.springframework.web.servlet.DispatcherServlet.triggerAfterCompletionWithError(DispatcherServlet.java:1303) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:977) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) cn.siggy.filter.CorsFilter.doFilter(CorsFilter.java:22) root cause java.lang.UnsupportedClassVersionError: cn/siggy/util/DBUtil cn.siggy.dao.DataDao.findList(DataDao.java:38) cn.siggy.controller.AllController.arrayData(AllController.java:34) sun.reflect.GeneratedMethodAccessor30.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) java.lang.reflect.Method.invoke(Method.java:606) org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:221) org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:110) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandleMethod(RequestMappingHandlerAdapter.java:776) org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:705) org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:85) org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:959) org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:893) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:966) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:857) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:842) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) cn.siggy.filter.CorsFilter.doFilter(CorsFilter.java:22) ![图片说明](https://img-ask.csdn.net/upload/201801/19/1516362712_884024.jpg)

Nginx发送“连接:关闭”而不是“连接:升级”到Golang后端

<div class="post-text" itemprop="text"> <p>I'm trying to <code>proxy_pass</code> a websocket with Nginx but I'm getting "502 Bad Gateway" and my Golang back end responds: "websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header".</p> <p>Nginx config:</p> <pre><code>server { listen 80; server_name eg.example.com; location / { include proxy_params; proxy_pass http://localhost:8000/; } location ~* /chatclientws/[\w\-]+ { include proxy_params; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; # Added a dummy header to see if Nginx is passing the request properly. proxy_set_header Dummy "Test"; proxy_pass "http://localhost:8000/chatclientws/$1/"; } } </code></pre> <p>Proxy_params:</p> <pre><code>proxy_set_header Host $http_host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-NginX-Proxy true; </code></pre> <p><code>httputil.DumpRequest()</code> in the Golang function for the route produces:</p> <pre><code>GET /chatclientws/13c21679-45b0-424a-872f-aa012a9ee7a0 HTTP/1.0 Host: eg.example.com # Connection says close. Connection: close Accept-Encoding: gzip, deflate Accept-Language: en-US,en;q=0.9,en-GB;q=0.8 Cache-Control: no-cache # Connection says close again. Connection: close Cookie: clientroom=13c21679-45b0-424a-872f-aa012a9ee7a0 Origin: eg.example.com Pragma: no-cache # But websocket request does come through. Sec-Websocket-Extensions: permessage-deflate; client_max_window_bits Sec-Websocket-Key: ykQiDfJ2Tr2Z88WtnBQkAw== Sec-Websocket-Version: 13 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.169 Safari/537.36 X-Forwarded-For: 92.54.215.31 X-Forwarded-Proto: http X-Nginx-Proxy: true X-Real-Ip: 92.54.215.31 </code></pre> <p>Somehow, Nginx is passing down all the information necessary except for the right Connection header.</p> <p>Or so it seems. As seen above, I added a dummy header, <code>proxy_set_header Dummy "Test";</code>, to see if Nginx is really passing the headers down. The dummy header never makes it through.</p> <p>On another page with the same Nginx config but without dynamically generated pathnames, dummy header and websocket connection work well. And, if I hardcode the pathname instead of using regex, like this:</p> <pre><code>location /chatclientws/1a904868-608d-42b2-9e02-4d7d4f8cef19 { ... proxy_pass "http://localhost:8000/chatclientws/1a904868-608d-42b2-9e02-4d7d4f8cef19"; } </code></pre> <p>It works.</p> <p>So, I believe I'm using regex wrongly here. But all the examples I've seen online seem to say my use is ok.</p> <p>I'm puzzled as well as to how the websocket upgrade request comes through. Why is Nginx selectively passing down information?</p> <p>How should I proceed from here?</p> </div>

在Linux系统下调用webservice出错,同样的代码在windows下正常。

出错信息如下: ``` HTTP Status 500 - Failed to access the WSDL at: http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl. It failed with: type Exception report message Failed to access the WSDL at: http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl. It failed with: description The server encountered an internal error that prevented it from fulfilling this request. exception javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl. It failed with: Got xx.xx.xx.cn while opening stream from http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl. com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:173) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:155) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120) com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:258) com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:221) com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:169) com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:101) javax.xml.ws.Service.<init>(Service.java:77) javax.xml.ws.Service.create(Service.java:707) gz.doGet(gz.java:54) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause java.io.IOException: Got xx.xx.xx.cn while opening stream from http://xx.xx.xx.cn/flfw-fw/webservice/test?wsdl com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:842) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:283) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:140) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120) com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:258) com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:221) com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:169) com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:101) javax.xml.ws.Service.<init>(Service.java:77) javax.xml.ws.Service.create(Service.java:707) gz.doGet(gz.java:54) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) root cause java.net.UnknownHostException: xx.xx.xx.cn java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:178) java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) java.net.Socket.connect(Socket.java:579) java.net.Socket.connect(Socket.java:528) sun.net.NetworkClient.doConnect(NetworkClient.java:180) sun.net.www.http.HttpClient.openServer(HttpClient.java:432) sun.net.www.http.HttpClient.openServer(HttpClient.java:527) sun.net.www.http.HttpClient.<init>(HttpClient.java:211) sun.net.www.http.HttpClient.New(HttpClient.java:308) sun.net.www.http.HttpClient.New(HttpClient.java:326) sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997) sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933) sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851) sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301) java.net.URL.openStream(URL.java:1037) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:827) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:283) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:140) com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120) com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:258) com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:221) com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:169) com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:101) javax.xml.ws.Service.<init>(Service.java:77) javax.xml.ws.Service.create(Service.java:707) gz.doGet(gz.java:54) javax.servlet.http.HttpServlet.service(HttpServlet.java:624) javax.servlet.http.HttpServlet.service(HttpServlet.java:731) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) note The full stack trace of the root cause is available in the Apache Tomcat/7.0.84 logs. ``` 请问 问题出在哪里??

如何从github获取go-socket.io以在Go中使用

<div class="post-text" itemprop="text"> <p>My Go version is:</p> <blockquote> <p>go version go1.12.9 windows/amd64</p> </blockquote> <p>From this link:</p> <p><a href="https://github.com/googollee/go-socket.io/tree/v1.0" rel="nofollow noreferrer">https://github.com/googollee/go-socket.io/tree/v1.0</a></p> <p>I run this code in cmd:</p> <blockquote> <p>go get github.com/googollee/go-socket.io</p> </blockquote> <p>But i cant run this code :</p> <pre><code>package main import ( "log" "net/http" "github.com/googollee/go-socket.io" ) func main() { server, err := socketio.NewServer(nil) if err != nil { log.Fatal(err) } server.On("connection", func(so socketio.Socket) { log.Println("on connection") so.Join("chat") so.On("chat message", func(msg string) { log.Println("emit:", so.Emit("chat message", msg)) server.BroadcastTo("chat", "chat message", msg) }) so.On("disconnection", func() { log.Println("on disconnect") }) }) server.On("error", func(so socketio.Socket, err error) { log.Println("error:", err) }) http.Handle("/socket.io/", server) http.Handle("/", http.FileServer(http.Dir("./asset"))) log.Println("Serving at localhost:5000...") log.Fatal(http.ListenAndServe(":5000", nil)) } </code></pre> <p>I cant run it , why?</p> <p>I think my problem is in getting V1.4 and v1.0 </p> <blockquote> <p>go get github.com/googollee/go-socket.io</p> </blockquote> <p>how can i get v1.0 for Golang from github?</p> <p>But this code work well</p> <pre><code>package main import ( "fmt" "log" "net/http" "github.com/googollee/go-socket.io" ) func main() { server, err := socketio.NewServer(nil) if err != nil { log.Fatal(err) } server.OnConnect("/", func(s socketio.Conn) error { s.SetContext("") fmt.Println("connected:", s.ID()) return nil }) http.Handle("/socket.io/", server) http.Handle("/", http.FileServer(http.Dir("./asset"))) log.Println("Serving at localhost:8000...") log.Fatal(http.ListenAndServe(":8000", nil)) } </code></pre> </div>

大学四年自学走来,这些私藏的实用工具/学习网站我贡献出来了

大学四年,看课本是不可能一直看课本的了,对于学习,特别是自学,善于搜索网上的一些资源来辅助,还是非常有必要的,下面我就把这几年私藏的各种资源,网站贡献出来给你们。主要有:电子书搜索、实用工具、在线视频学习网站、非视频学习网站、软件下载、面试/求职必备网站。 注意:文中提到的所有资源,文末我都给你整理好了,你们只管拿去,如果觉得不错,转发、分享就是最大的支持了。 一、电子书搜索 对于大部分程序员...

在中国程序员是青春饭吗?

今年,我也32了 ,为了不给大家误导,咨询了猎头、圈内好友,以及年过35岁的几位老程序员……舍了老脸去揭人家伤疤……希望能给大家以帮助,记得帮我点赞哦。 目录: 你以为的人生 一次又一次的伤害 猎头界的真相 如何应对互联网行业的「中年危机」 一、你以为的人生 刚入行时,拿着傲人的工资,想着好好干,以为我们的人生是这样的: 等真到了那一天,你会发现,你的人生很可能是这样的: ...

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

我以为我学懂了数据结构,直到看了这个导图才发现,我错了

数据结构与算法思维导图

技术大佬:我去,你写的 switch 语句也太老土了吧

昨天早上通过远程的方式 review 了两名新来同事的代码,大部分代码都写得很漂亮,严谨的同时注释也很到位,这令我非常满意。但当我看到他们当中有一个人写的 switch 语句时,还是忍不住破口大骂:“我擦,小王,你丫写的 switch 语句也太老土了吧!” 来看看小王写的代码吧,看完不要骂我装逼啊。 private static String createPlayer(PlayerTypes p...

和黑客斗争的 6 天!

互联网公司工作,很难避免不和黑客们打交道,我呆过的两家互联网公司,几乎每月每天每分钟都有黑客在公司网站上扫描。有的是寻找 Sql 注入的缺口,有的是寻找线上服务器可能存在的漏洞,大部分都...

Linux 会成为主流桌面操作系统吗?

整理 |屠敏出品 | CSDN(ID:CSDNnews)2020 年 1 月 14 日,微软正式停止了 Windows 7 系统的扩展支持,这意味着服役十年的 Windows 7,属于...

讲一个程序员如何副业月赚三万的真实故事

loonggg读完需要3分钟速读仅需 1 分钟大家好,我是你们的校长。我之前讲过,这年头,只要肯动脑,肯行动,程序员凭借自己的技术,赚钱的方式还是有很多种的。仅仅靠在公司出卖自己的劳动时...

学习总结之HTML5剑指前端(建议收藏,图文并茂)

前言学习《HTML5与CSS3权威指南》这本书很不错,学完之后我颇有感触,觉得web的世界开明了许多。这本书是需要有一定基础的web前端开发工程师。这本书主要学习HTML5和css3,看...

女程序员,为什么比男程序员少???

昨天看到一档综艺节目,讨论了两个话题:(1)中国学生的数学成绩,平均下来看,会比国外好?为什么?(2)男生的数学成绩,平均下来看,会比女生好?为什么?同时,我又联想到了一个技术圈经常讨...

搜狗输入法也在挑战国人的智商!

故事总是一个接着一个到来...上周写完《鲁大师已经彻底沦为一款垃圾流氓软件!》这篇文章之后,鲁大师的市场工作人员就找到了我,希望把这篇文章删除掉。经过一番沟通我先把这篇文章从公号中删除了...

副业收入是我做程序媛的3倍,工作外的B面人生是怎样的?

提到“程序员”,多数人脑海里首先想到的大约是:为人木讷、薪水超高、工作枯燥…… 然而,当离开工作岗位,撕去层层标签,脱下“程序员”这身外套,有的人生动又有趣,马上展现出了完全不同的A/B面人生! 不论是简单的爱好,还是正经的副业,他们都干得同样出色。偶尔,还能和程序员的特质结合,产生奇妙的“化学反应”。 @Charlotte:平日素颜示人,周末美妆博主 大家都以为程序媛也个个不修边幅,但我们也许...

MySQL数据库面试题(2020最新版)

文章目录数据库基础知识为什么要使用数据库什么是SQL?什么是MySQL?数据库三大范式是什么mysql有关权限的表都有哪几个MySQL的binlog有有几种录入格式?分别有什么区别?数据类型mysql有哪些数据类型引擎MySQL存储引擎MyISAM与InnoDB区别MyISAM索引与InnoDB索引的区别?InnoDB引擎的4大特性存储引擎选择索引什么是索引?索引有哪些优缺点?索引使用场景(重点)...

新一代神器STM32CubeMonitor介绍、下载、安装和使用教程

关注、星标公众号,不错过精彩内容作者:黄工公众号:strongerHuang最近ST官网悄悄新上线了一款比较强大的工具:STM32CubeMonitor V1.0.0。经过我研究和使用之...

记一次腾讯面试,我挂在了最熟悉不过的队列上……

腾讯后台面试,面试官问:如何自己实现队列?

如果你是老板,你会不会踢了这样的员工?

有个好朋友ZS,是技术总监,昨天问我:“有一个老下属,跟了我很多年,做事勤勤恳恳,主动性也很好。但随着公司的发展,他的进步速度,跟不上团队的步伐了,有点...

我入职阿里后,才知道原来简历这么写

私下里,有不少读者问我:“二哥,如何才能写出一份专业的技术简历呢?我总感觉自己写的简历太烂了,所以投了无数份,都石沉大海了。”说实话,我自己好多年没有写过简历了,但我认识的一个同行,他在阿里,给我说了一些他当年写简历的方法论,我感觉太牛逼了,实在是忍不住,就分享了出来,希望能够帮助到你。 01、简历的本质 作为简历的撰写者,你必须要搞清楚一点,简历的本质是什么,它就是为了来销售你的价值主张的。往深...

冒泡排序动画(基于python pygame实现)

本项目效果初始截图如下 动画见本人b站投稿:https://www.bilibili.com/video/av95491382 本项目对应github地址:https://github.com/BigShuang python版本:3.6,pygame版本:1.9.3。(python版本一致应该就没什么问题) 样例gif如下 ======================= 大爽歌作,mad

Redis核心原理与应用实践

Redis核心原理与应用实践 在很多场景下都会使用Redis,但是到了深层次的时候就了解的不是那么深刻,以至于在面试的时候经常会遇到卡壳的现象,学习知识要做到系统和深入,不要把Redis想象的过于复杂,和Mysql一样,是个读取数据的软件。 有一个理解是Redis是key value缓存服务器,更多的优点在于对value的操作更加丰富。 安装 yum install redis #yum安装 b...

现代的 “Hello, World”,可不仅仅是几行代码而已

作者 |Charles R. Martin译者 | 弯月,责编 | 夕颜头图 |付费下载自视觉中国出品 | CSDN(ID:CSDNnews)新手...

带了6个月的徒弟当了面试官,而身为高级工程师的我天天修Bug......

即将毕业的应届毕业生一枚,现在只拿到了两家offer,但最近听到一些消息,其中一个offer,我这个组据说客户很少,很有可能整组被裁掉。 想问大家: 如果我刚入职这个组就被裁了怎么办呢? 大家都是什么时候知道自己要被裁了的? 面试软技能指导: BQ/Project/Resume 试听内容: 除了刷题,还有哪些技能是拿到offer不可或缺的要素 如何提升面试软实力:简历, 行为面试,沟通能...

!大部分程序员只会写3年代码

如果世界上都是这种不思进取的软件公司,那别说大部分程序员只会写 3 年代码,恐怕就没有程序员这种职业。

离职半年了,老东家又发 offer,回不回?

有小伙伴问松哥这个问题,他在上海某公司,在离职了几个月后,前公司的领导联系到他,希望他能够返聘回去,他很纠结要不要回去? 俗话说好马不吃回头草,但是这个小伙伴既然感到纠结了,我觉得至少说明了两个问题:1.曾经的公司还不错;2.现在的日子也不是很如意。否则应该就不会纠结了。 老实说,松哥之前也有过类似的经历,今天就来和小伙伴们聊聊回头草到底吃不吃。 首先一个基本观点,就是离职了也没必要和老东家弄的苦...

2020阿里全球数学大赛:3万名高手、4道题、2天2夜未交卷

阿里巴巴全球数学竞赛( Alibaba Global Mathematics Competition)由马云发起,由中国科学技术协会、阿里巴巴基金会、阿里巴巴达摩院共同举办。大赛不设报名门槛,全世界爱好数学的人都可参与,不论是否出身数学专业、是否投身数学研究。 2020年阿里巴巴达摩院邀请北京大学、剑桥大学、浙江大学等高校的顶尖数学教师组建了出题组。中科院院士、美国艺术与科学院院士、北京国际数学...

为什么你不想学习?只想玩?人是如何一步一步废掉的

不知道是不是只有我这样子,还是你们也有过类似的经历。 上学的时候总有很多光辉历史,学年名列前茅,或者单科目大佬,但是虽然慢慢地长大了,你开始懈怠了,开始废掉了。。。 什么?你说不知道具体的情况是怎么样的? 我来告诉你: 你常常潜意识里或者心理觉得,自己真正的生活或者奋斗还没有开始。总是幻想着自己还拥有大把时间,还有无限的可能,自己还能逆风翻盘,只不是自己还没开始罢了,自己以后肯定会变得特别厉害...

HTTP与HTTPS的区别

面试官问HTTP与HTTPS的区别,我这样回答让他竖起大拇指!

程序员毕业去大公司好还是小公司好?

虽然大公司并不是人人都能进,但我仍建议还未毕业的同学,尽力地通过校招向大公司挤,但凡挤进去,你这一生会容易很多。 大公司哪里好?没能进大公司怎么办?答案都在这里了,记得帮我点赞哦。 目录: 技术氛围 内部晋升与跳槽 啥也没学会,公司倒闭了? 不同的人脉圈,注定会有不同的结果 没能去大厂怎么办? 一、技术氛围 纵观整个程序员技术领域,哪个在行业有所名气的大牛,不是在大厂? 而且众所...

男生更看重女生的身材脸蛋,还是思想?

往往,我们看不进去大段大段的逻辑。深刻的哲理,往往短而精悍,一阵见血。问:产品经理挺漂亮的,有点心动,但不知道合不合得来。男生更看重女生的身材脸蛋,还是...

程序员为什么千万不要瞎努力?

本文作者用对比非常鲜明的两个开发团队的故事,讲解了敏捷开发之道 —— 如果你的团队缺乏统一标准的环境,那么即使勤劳努力,不仅会极其耗时而且成果甚微,使用...

为什么程序员做外包会被瞧不起?

二哥,有个事想询问下您的意见,您觉得应届生值得去外包吗?公司虽然挺大的,中xx,但待遇感觉挺低,马上要报到,挺纠结的。

立即提问
相关内容推荐