→ hn12404988: 補充:是browser的xmlhttprequest的POST 10/16 11:20
推 kenduest: 自己實作 http server 嗎?有處理細節流程嗎? 10/16 13:08
推 kenduest: 比方 http 1.0 與 1.1 連線溝通的差異 10/16 13:13
→ hn12404988: 我知道1.0和1.1,但我不知道原來我也要作這個 10/16 13:23
→ hn12404988: 我以為Nginx會幫我作這方面的東西,那看來差有點遠 10/16 13:24
→ hn12404988: 其實只是很簡單的accept connection,然後send回去 10/16 13:25
→ hn12404988: code在neural_socket資料夾裡的socket_server.cpp 10/16 13:28
→ hn12404988: 從80行開始看,就是簡單開新thread, 在send回去 10/16 13:28
推 kenduest: 沒有實做1.1的話溝通完就需要切斷連線 10/16 13:37
推 kenduest: proxy_pass 當時候 nginx 是 client, 你的程式是 server 10/16 13:48
→ kenduest: ,nginx 請求就是標準方式 10/16 13:48
→ soem: nginx的proxy_pass是標準的http request,你要的應該不是這個 10/16 13:58
→ hn12404988: 了解了解,謝謝提醒,那我再去查其他pass方式 10/16 14:45
推 kenduest: 樓主只是要純 tcp proxy 還是 10/16 14:57
→ hn12404988: 對,想要Nginx單純tcp/unix socket傳送資訊就好 10/16 15:54
推 kenduest: nginx 可以支援,官方文件有說明 10/16 16:36
→ kenduest: 不過一般是 tcp socket 非 unix domain socket 10/16 16:36
推 kenduest: 您自己測試 unix:/path/file 這種語法看看,我自己沒有 10/16 16:39
→ kenduest: 這樣用過就是 10/16 16:39
→ hn12404988: fastcgi_pass 可以直接 unix:/path/file 10/16 17:06
→ hn12404988: 謝謝你的建議,我覺得我要去看一些http傳輸協定的東西 10/16 17:06
→ hn12404988: 或是nginx有其他的_pass,我還沒研究 10/16 17:07
→ soem: 其實偷懶的作法就是用python/ruby當http server那層,再接上 10/17 00:42
→ soem: 你的code就完成了這樣XD 10/17 00:43
→ soem: 甚至連socket都不太需要寫,直接call就好 10/17 00:44