Giter Site home page Giter Site logo

Comments (34)

mslosarz avatar mslosarz commented on September 22, 2024

Hello,

Project nextrtc-signaling-server is a library which must be run in the
container. The basic example how to use it you can find here:
https://github.com/mslosarz/nextrtc-example-videochat
If you want more sophisticated example you can look into
https://github.com/mslosarz/nextrtc-videochat-with-rest
where there is a sample how to react on events which came from signaling
server (mainly this package will be interesting for you:
https://github.com/mslosarz/nextrtc-videochat-with-rest/tree/master/src/main/java/org/nextrtc/examples/videochat_with_rest/domain/handler
)

Best regards

2016-09-08 9:48 GMT+02:00 TaekminKwon [email protected]:

Additionally,
If I want to use signaling server, do I need to create or modify your code?

I searched about your code, but I did not find anything about your code
enough.
If you are OK, please reply my questions.
Thanks.


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysReNtFY-xcy_o3QCmM2ONM31x92Mfks5qn72-gaJpZM4J3iui
.

Marcin Ślósarz

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Hello
Thanks for your comment.
I was succesfully able to run your sample app(nextrtc-videochat with rest).

I also have questions about your sample app.
I am writing the procedure I did.

  1. connect "localhost:8080_ --> No problem
  2. register ID, PW, Name --> No problem
  3. sign in Name, PW
    --> It has, I cannot sign in with Name, Pw which I already registered. I think It kinda DB connection problem, because I don't use it. let me know the details. Thanks
    anyway, I can connect using this "/action/verify/b588b3d4-6836-4f9c-98fa-b71268db313f"

4.Using next rtc App --> No problem.

and then, I wanted to use this app on my smart phone,
above procedure, 1,2,3 is the same as PC web.(I use the same wifi, because of NAT)
But number 4 didn't operate.

I tried more and had strange things to me.
When I connected "localhost:8080" ... I got number 3 problem(above) problem, anyway I could see nextRtc sample app operated.
But, when I connected "x.x.x.x:8080"(my IP), It appeared Number 4 couldn't operate.

I want to know why it happend and whether I need to modify code on App.
Thanks.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

you have to use https instead of http if you want to use your mobile in
tests. (as you can see I'm using https on my example page
https://examples.nextrtc.org/videochat/)
There was a small bug in nextrtc-videochat-with-rest, try to pull changes
and retest.

2016-09-09 10:50 GMT+02:00 TaekminKwon [email protected]:

Hello
Thanks for your comment.
I was succesfully able to run your sample app(nextrtc-videochat with rest).

I also have questions about your sample app.
I am writing the procedure I did.

_1. connect "localhost:8080 --> No problem

register ID, PW, Name --> No problem
2.

sign in Name, PW_

--> It has, I cannot sign in with Name, Pw which I already registered.
I think It kinda DB connection problem, because I don't use it. let me know
the details. Thanks
anyway, I can connect using this "/action/verify/b588b3d4-6836-4f9c-98fa-b71268db313f"

4.Using next rtc App --> No problem.

and then, I wanted to use this app on my smart phone,
above procedure, 1,2,3 is the same as PC web.(I use the same wifi, because
of NAT)
But number 4 didn't operate.

I tried more and had strange things to me.
When I connected "localhost:8080" ... I got number 3 problem(above)
problem, anyway I could see nextRtc sample app operated.
But, when I connected "x.x.x.x:8080"(my IP), It appeared Number 4 couldn't
operate.

I want to know why it happend and whether I need to modify code on App.
Thanks.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysRW06PcGKoDq4F5F3uKjlcb_uV0X8ks5qoR3jgaJpZM4J3iui
.

Marcin Ślósarz

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

I appreciate for your reply.
but, I have the same problem, even if you fixed small bug. I tried a few times.
(but http://localhost:8080 is successfully connected)
and when I tried to connect to https instead of http, I got the ERR_TIMEOUT on the browser.
(like https://1.1.1.1:8080)
So, it can't be solution for me.

I want to make sure why it can't operate it for only my site.
So, I leave the log when I tried localhost:8080 and when I did x.x.x.x:8080(my local IP).

[When I use localhost:8080]

  • when I click the "sign in" button, the log appears as like this below.

2016-09-12 15:24:07 INFO NextRTCEndpoint:26 - Created org.nextrtc.examples.videochat_with_rest.MyEndpoint@2d572191
2016-09-12 15:24:07 INFO NextRTCEndpoint:57 - Setted server: org.nextrtc.signalingserver.domain.Server@242edc01 to org.nextrtc.examples.videochat_with_rest.MyEndpoint@2d572191
2016-09-12 15:24:07 INFO NextRTCEndpoint:32 - Opening: 0
2016-09-12 15:24:07 INFO NextRTCEventBus:21 - POSTED EVENT: SESSION_OPENED (Optional[org.nextrtc.signalingserver.api.NextRTCEvents$$Lambda$22/59110262@32d780cd]) <- Optional.empty -> (Optional.empty)
Hibernate:
select
user0_.user_id as user_id1_3_,
user0_.confirmation_key as confirma2_3_,
user0_.confirmed as confirme3_3_,
user0_.email as email4_3_,
user0_.password as password5_3_,
user0_.role as role6_3_,
user0_.username as username7_3_
from
Users user0_
where
user0_.username=?
Hibernate:
insert
into
Members
(member_id, connected, disconnected, left_reason, member_rtc_id, user_id)
values
(null, ?, ?, ?, ?, ?)
2016-09-12 15:24:07 INFO SessionOpenedService:37 - Created member: (1, 0)[2016-09-12T15:24:07.185+09:00 - null]
2016-09-12 15:24:11.480 INFO 2580 --- [ndardContext[]]] org.apache.catalina.webresources.Cache : The background cache eviction process was unable to free [10] percent of the cache for Context [] - consider increasing the maximum size of the cache. After eviction approximately [9,631] KB of data remained in the cache.


[When I use my local ip : x.x.x.x:8080 (ex, 152.23.0.1:8080)]

I can register and sign in the name and password, but I just can't create and join the room!!
It has small difference between when I sign in the ID and password on localhost and when I did on using my IP.


2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : DispatcherServlet with name 'dispatcherServlet' processing GET request for [/login]
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping : Looking up handler method for path /login
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping : Did not find handler method for [/login]
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] o.s.w.s.handler.SimpleUrlHandlerMapping : Mapping [/login] to HandlerExecutionChain with handler [org.springframework.web.servlet.mvc.ParameterizableViewController@366fa24] and 1 interceptor
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : Last-Modified value for [/login] is: -1
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : Rendering view [org.thymeleaf.spring4.view.ThymeleafView@78f0dc9a] in DispatcherServlet with name 'dispatcherServlet'
2016-09-12 15:32:55.267 DEBUG 30464 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet : Successfully completed request


the logs like sql query don't appear when I connect to my IP.
I haven't seen this situation before.

Two questions

  1. Could you tell me where I am able to modify code or fix it, if I want to connect using my IP?
  2. If I sign in ID and Password not using this ; "/action/verify/b588b3d4-6836-4f9c-98fa-b71268db313f", I always see "Invalid name or ID". Why it happen? Let me know detail.

Thanks.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024
  1. Please attach client side logs (console output from browser). In my
    opinion your browser has blocked websocket connection because the
    connection is not secure. (you're not using https, (how to do it in tomcat:
    https://tomcat.apache.org/tomcat-8.0-doc/ssl-howto.html)
  2. Because your account isn't verified (by enter url /action/verify/{key}
    you're verifying your account)

Application (nextrtc-videochat-with-rest) is just proof of concept that
nextrtc is easy to configure with spring-security, and it's possible to
store information about events, and it's still in development.

2016-09-12 8:42 GMT+02:00 TaekminKwon [email protected]:

I appreciate for your reply.
but, I have the same problem, even if you fixed small bug. I tried a few
times.
(but http://localhost:8080 is successfully connected)
and when I tried to connect to https instead of http, I got the
ERR_TIMEOUT on the browser.
(like https://1.1.1.1:8080)
So, it can't be solution for me.

I want to make sure why it can't operate it for only my site.
So, I leave the log when I tried localhost:8080 and when I did
x.x.x.x:8080(my local IP).

[When I use localhost:8080]

  • when I click the "sign in" button, the log appears as like this
    below.

2016-09-12 15:24:07 INFO NextRTCEndpoint:26 - Created
org.nextrtc.examples.videochat_with_rest.MyEndpoint@2d57219
https://github.com/org.nextrtc.examples.videochat_with_rest.MyEndpoint/nextrtc-signaling-server/commit/2d572191
2016-09-12 15:24:07 INFO NextRTCEndpoint:57 - Setted server:
org.nextrtc.signalingserver.domain.Server@242edc0
https://github.com/org.nextrtc.signalingserver.domain.Server/nextrtc-signaling-server/commit/242edc01
to org.nextrtc.examples.videochat_with_rest.MyEndpoint@2d57219
https://github.com/org.nextrtc.examples.videochat_with_rest.MyEndpoint/nextrtc-signaling-server/commit/2d572191
2016-09-12 15:24:07 INFO NextRTCEndpoint:32 - Opening: 0
2016-09-12 15:24:07 INFO NextRTCEventBus:21 - POSTED EVENT: SESSION_OPENED
(Optional[org.nextrtc.signalingserver.api.NextRTCEvents$$Lambda$22/
59110262@32d780cd]) <- Optional.empty -> (Optional.empty)
Hibernate:
select
user0_.user_id as user_id1_3_,
user0_.confirmation_key as confirma2_3_,
user0_.confirmed as confirme3_3_,
user0_.email as email4_3_,
user0_.password as password5_3_,
user0_.role as role6_3_,
user0_.username as username7_3_
from
Users user0_
where
user0_.username=?
Hibernate:
insert
into
Members
(member_id, connected, disconnected, left_reason, member_rtc_id, user_id)
values
(null, ?, ?, ?, ?, ?)
2016-09-12 15:24:07 INFO SessionOpenedService:37 - Created member: (1,
0)[2016-09-12T15:24:07.185+09:00 - null]
2016-09-12 15:24:11.480 INFO 2580 --- [ndardContext[]]]
org.apache.catalina.webresources.Cache : The background cache eviction
process was unable to free [10] percent of the cache for Context [] -
consider increasing the maximum size of the cache. After eviction

approximately [9,631] KB of data remained in the cache.

[When I use my local ip : x.x.x.x:8080 (ex, 152.23.0.1:8080
http://152.23.0.1:8080)]

I can register and sign in the name and password, but I just can't create
and join the room!!
It has small difference between when I sign in the ID and password on

localhost and when I did on using my IP.

2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet
: DispatcherServlet with name 'dispatcherServlet' processing GET request
for [/login]
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping
: Looking up handler method for path /login
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] s.w.s.m.m.a.RequestMappingHandlerMapping
: Did not find handler method for [/login]
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] o.s.w.s.handler.SimpleUrlHandlerMapping
: Mapping [/login] to HandlerExecutionChain with handler [
org.springframework.web.servlet.mvc.ParameterizableViewController@366fa24
https://github.com/org.springframework.web.servlet.mvc.ParameterizableViewController/nextrtc-signaling-server/commit/366fa24]
and 1 interceptor
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet
: Last-Modified value for [/login] is: -1
2016-09-12 15:32:55.266 DEBUG 30464 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet
: Rendering view [org.thymeleaf.spring4.view.ThymeleafView@78f0dc9
https://github.com/org.thymeleaf.spring4.view.ThymeleafView/nextrtc-signaling-server/commit/78f0dc9a]
in DispatcherServlet with name 'dispatcherServlet'
2016-09-12 15:32:55.267 DEBUG 30464 --- [nio-8080-exec-8] o.s.web.servlet.DispatcherServlet

: Successfully completed request

the logs like sql query don't appear when I connect to my IP.
I haven't seen this situation before.

Two questions

  1. Could you tell me where I am able to modify code or fix it, if I want
    to connect using my IP?
  2. If I sign in ID and Password not using this ;
    "/action/verify/b588b3d4-6836-4f9c-98fa-b71268db313f", I always see
    "Invalid name or ID". Why it happen? Let me know detail.

Thanks.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysRfbewsvCSlU22CiTMd1nxC33nrjJks5qpPRsgaJpZM4J3iui
.

Marcin Ślósarz

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Hello, Thank you for your reply.

  1. Yes, that's right. The reason is "connection is not insecure".
  2. I got it.

(about Num. 1)
[log]
This appears to be Chrome
adapter.js:35 chrome: {"video":true,"audio":true}
adapter.js:441 getUserMedia() no longer works on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
nextRTC.js:199 error {}

I searched "Chrome 47 WebRTC: media recording, secure origins & proxy handling"
getUserMedia() requests is allowed from secure(https or localhost)

So, I need to secure the application using https.

but when I connected https, console shows this err log.
(x is number of IP)
[log]
GET https://192.x.x.x:8080/conversation.html net::ERR_SSL_PROTOCOL_ERROR
https://192.x.x.x:8080/conversation.html:1 GET https://192.x.x.x:8080/conversation.html net::ERR_TIMED_OUT

(https://tomcat.apache.org/tomcat-8.0-doc/ssl-howto.html
https://google.com
I can connect above url)

Q. please let me know how to apply secure origin; https to your application.

I sincerely appreciate your endeavour to develope new things.
Thanks.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

I'll write tutorial how to setup https in sample app but I think that it
should be described in spring boot documentation

19 wrz 2016 04:15 "TaekminKwon" [email protected] napisał(a):

Hello, Thank you for your reply.

  1. Yes, that's right. The reason is "connection is not insecure".

[log]

This appears to be Chrome adapter.js:35 chrome:
{"video":true,"audio":true} adapter.js:441 getUserMedia() no longer works
on insecure origins. To use this feature, you should consider switching
your application to a secure origin, such as HTTPS. See
https://goo.gl/rStTGz https://goo.gl/rStTGz for more details.
nextRTC.js:199 error {}

I searched "Chrome 47 WebRTC: media recording, secure origins & proxy
handling"
getUserMedia() requests is allowed from secure(https or localhost)

So, I need to secure the application using https.

but when I connected https, console shows this err log.
log http://x%20is%20number%20of%20IP

GET https://192.x.x.x:8080/conversation.html
https://192.x.x.x:8080/conversation.html net::ERR_SSL_PROTOCOL_ERROR
https://192.x.x.x:8080/conversation.html:1
https://192.x.x.x:8080/conversation.html:1 GET
https://192.x.x.x:8080/conversation.html
https://192.x.x.x:8080/conversation.html net::ERR_TIMED_OUT

(https://tomcat.apache.org/tomcat-8.0-doc/ssl-howto.html
https://google.com
I can connect above url)

  1. I got it.

Q. please let me know how to apply secure origin; https to your
application.

I sincerely appreciate your endeavour to develope new things.
Thanks.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysRWaC02Np6FRpgI0R8mexemRTM7Qaks5qrfA1gaJpZM4J3iui
.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

To setup your app with https you have to:
add to application.properties:
server.port=8433
server.ssl.key-store=classpath:keystore.jks
server.ssl.key-store-password=password
server.ssl.key-password=password
server.ssl.key-store-type=JKS
server.ssl.key-store-provider=SUN
server.ssl.key-alias=tomcat

change wsURL in index.html to:
wsURL : 'wss://127.0.0.1:8433/signaling',

enter to directory src/main/resources
and generate self signed certificate:
keytool -genkey -alias tomcat -keyalg RSA -keystore keystore.jks

Enter keystore password: password
Re-enter new password: password
What is your first and last name?

What is the name of your organizational unit?

What is the name of your organization?

What is the name of your City or Locality?

What is the name of your State or Province?

What is the two-letter country code for this unit?

Is CN=127.0.0.1, OU=Develepment, O=NextRTC, L=Cracow, ST=Malopolskie, C=PL corre
ct?

Enter key password for (RETURN if same as keystore password):

then:

  • run: mvn clean install && java -jar target/videochat.war
  • enter https://localhost:8433 in your favourite browser
  • accept untrusted certificate

2016-09-19 20:54 GMT+02:00 Marcin Ślósarz [email protected]:

I'll write tutorial how to setup https in sample app but I think that it
should be described in spring boot documentation

19 wrz 2016 04:15 "TaekminKwon" [email protected] napisał(a):

Hello, Thank you for your reply.

  1. Yes, that's right. The reason is "connection is not insecure".

[log]

This appears to be Chrome adapter.js:35 chrome:
{"video":true,"audio":true} adapter.js:441 getUserMedia() no longer works
on insecure origins. To use this feature, you should consider switching
your application to a secure origin, such as HTTPS. See
https://goo.gl/rStTGz https://goo.gl/rStTGz for more details.
nextRTC.js:199 error {}

I searched "Chrome 47 WebRTC: media recording, secure origins & proxy
handling"
getUserMedia() requests is allowed from secure(https or localhost)

So, I need to secure the application using https.

but when I connected https, console shows this err log.
log http://x%20is%20number%20of%20IP

GET https://192.x.x.x:8080/conversation.html
https://192.x.x.x:8080/conversation.html net::ERR_SSL_PROTOCOL_ERROR
https://192.x.x.x:8080/conversation.html:1
https://192.x.x.x:8080/conversation.html:1 GET
https://192.x.x.x:8080/conversation.html
https://192.x.x.x:8080/conversation.html net::ERR_TIMED_OUT

(https://tomcat.apache.org/tomcat-8.0-doc/ssl-howto.html
https://google.com
I can connect above url)

  1. I got it.

Q. please let me know how to apply secure origin; https to your
application.

I sincerely appreciate your endeavour to develope new things.
Thanks.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysRWaC02Np6FRpgI0R8mexemRTM7Qaks5qrfA1gaJpZM4J3iui
.

Marcin Ślósarz

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

If you want you can check it I've created branch with https configuraiton:
https://github.com/mslosarz/nextrtc-example-videochat/tree/default_ssl
and here
https://github.com/mslosarz/nextrtc-videochat-with-rest/tree/default_ssl

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Thank you.
I didn't you did comment.
I actually solved that issue to make private ssl and I can connect the server application on various smart phone devices now.

Anyway, Could you tell me how to compile App on Eclipse?
or any comments and descriptions about that?
I want to debug to follow your code, but it's quite difficult and unfarmiliar to excute debug mode on Linux console.
when nextrtc_viceochat_withrest run on server(tomcat8), it spilt error like this.

2016-10-10 11:21:14.608 INFO 9660 --- [ost-startStop-1] o.s.w.s.s.s.ServerEndpointExporter : Registering @serverendpoint class: class org.nextrtc.examples.videochat_with_rest.MyEndpoint
2016-10-10 11:21:14.626 ERROR 9660 --- [ost-startStop-1] o.s.boot.SpringApplication : Application startup failed

java.lang.IllegalStateException: Failed to register @serverendpoint class: class org.nextrtc.examples.videochat_with_rest.MyEndpoint
at org.springframework.web.socket.server.standard.ServerEndpointExporter.registerEndpoint(ServerEndpointExporter.java:148) ~[spring-websocket-4.2.5.RELEASE.jar:4.2.5.RELEASE]

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

I think that you're using too old tomcat version try 8+ or you should
remove two beans from NextRTCEndpointConfig (MyEndpoint and
ServerEndpointExporter) there were added for embedded tomcat.
The best way to debug is configure jpda and connect to server as to remote
process (
http://javarevisited.blogspot.com/2011/02/how-to-setup-remote-debugging-in.html?m=1)
or setup tomcat in eclipse directly

Best regards

10 paź 2016 06:25 "TaekminKwon" [email protected] napisał(a):

Thank you.
I didn't you did comment.
I actually solved that issue to make private ssl and I can connect the
server application on various smart phone devices now.

Anyway, Could you tell me how to compile App on Eclipse?
or any comments and descriptions about that?
I want to debug to follow your code, but it's quite difficult and
unfarmiliar to excute debug mode on Linux console.
when nextrtc_viceochat_withrest run on server, it spilt error like this.

2016-10-10 11:21:14.608 INFO 9660 --- [ost-startStop-1] o.s.w.s.s.s.ServerEndpointExporter
: Registering @serverendpoint class: class org.nextrtc.examples.
videochat_with_rest.MyEndpoint
2016-10-10 11:21:14.626 ERROR 9660 --- [ost-startStop-1]
o.s.boot.SpringApplication : Application startup failed

java.lang.IllegalStateException: Failed to register @serverendpoint
class: class org.nextrtc.examples.videochat_with_rest.MyEndpoint
at org.springframework.web.socket.server.standard.ServerEndpointExporter.
registerEndpoint(ServerEndpointExporter.java:148)
~[spring-websocket-4.2.5.RELEASE.jar:4.2.5.RELEASE]


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysRZe_PdU88ZAQ1akfda-Bhj2LP1JEks5qyb5RgaJpZM4J3iui
.

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Hi,
what's up? I feel like post issue in a long time.
I am still developing server and client site with your code.

but I got some problems, the part of calling REST api.
I am not sure It is partly related to nextRTC signaling server. If you don't mind it, I wish you would help me out to solve problems. :)

I want to call rest api to load login session from my database.
The flow is..
Client : XML throws request to Server following https://IP:PORT/v0.1/login
Server : server prepared to receive client's request.
making the class using this annotation @RequestMapping("/v0.1/login") (It is the same way you created RegisterController.java)

However, I always get "forbidden" 403 error including message "Expected CSRF token not found. Has your session expired?", even if I set 'X-CSRF-TOKEN' header in client.
I tried to search it. I found this is only offering more than Spring version 3.2.
but, in running your code, it doesn't seem to need CSRF token.

please post your ideas, if you know kinds of solutions or recommendation to solve this problem.
Thank you.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

Hello

If you dont need csrf you can easly disable it in configuration (method
disableCsrf or something simillar). I dont remember how to provide csrf
token to webapp (I suspect its standalone app)

Best regards

5 lis 2016 09:43 "TaekminKwon" [email protected] napisał(a):

Hi,
what's up? I feel like post issue in a long time.
I am still developing server and client site with your code.

but I got some problems, the part of calling REST api.
I am not sure It is partly related to nextRTC signaling server. If you
don't mind it, I wish you would help me out to solve problems. :)

I want to call rest api to load login session from my database.
The flow is..
Client : XML throws request to Server following https://IP:PORT/v0.1/login
Server : server prepared to receive client's request.
making the class using this annotation @RequestMapping("/v0.1/login") (It
is the same way you created RegisterController.java)

However, I always get "forbidden" 403 error including message "Expected
CSRF token not found. Has your session expired?", even if I set
'X-CSRF-TOKEN' header in client.
I tried to search it. I found this is only offering more than Spring
version 3.2.
but, in running your code, it doesn't seem to need CSRF token.

please post your ideas, if you know kinds of solutions or recommendation
to solve this problem.
Thank you.


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#11 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ADysRdX5hPPo0fiRx0C4NTfC71zN_Reyks5q7EGpgaJpZM4J3iui
.

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Hi,
Thanks for your response.
I am curious that you are not still offering application(nextrtc videochat with rest) using signaling server.
No reference here more.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Hi.
I fixed the above issues before. Thanks for your answer anyway.

I almost make my server using your library.
but I got one issue too.

this is about Exception handler.

I understood that onError method will handle the error or situation after getting error, when Server got Error.

but when the server got Error, It executes onError method infinitely. It means that it is not able to handle the error.

My code and flow are here below.
1. the error happen
2. InvocationTargetException in InvocationTargetException.java executes right after
3. onError method is executed in NextRTCEndPoint class
my onError code is here

    @OnError
    public void onError(Session session, Throwable exception) {
        log.info("Occured exception for session: " + session.getId());
        log.error(exception.getCause());
    }

I put off "server.handleError(parm)", so It just only shows the log, do nothing.
4. After that, onError method is executed again infinitely.

I want to fix this issue as soon as possible.
If you have idea to fix it, I appreciate to let me know.
Thanks.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Do you know the reason why it makes infinity loops?

//
that is EOFException. I don't know how can control.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Thanks for reply and your favor.
but, I have something I want to know.
If unregister method in server.handleError is not executed, does Error(EOFException) occured continueously?

I have been building the project using your library, so I changed some parts for my application.

I will appreciate that you response me ASAP.
Thanks.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

I don't think so. I erased ping task.

the error log is here.
java.io.EOFException
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.fillReadBuffer(NioEndpoint.java:1267)
at org.apache.tomcat.util.net.NioEndpoint$NioSocketWrapper.isReadyForRead(NioEndpoint.java:1176)
at org.apache.tomcat.websocket.server.WsFrameServer.onDataAvailable(WsFrameServer.java:58)
at org.apache.tomcat.websocket.server.WsHttpUpgradeHandler.upgradeDispatch(WsHttpUpgradeHandler.java:148)
at org.apache.coyote.http11.upgrade.UpgradeProcessorInternal.dispatch(UpgradeProcessorInternal.java:54)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:53)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:788)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1485)
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)

//////////////////////////////////////////////////////////

I handled that issue. The reason is tomcat version.
anyway, Thanks.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

In version 0.0.5 There are improvements in handling errors maybe It'll help you

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Hi,
Thanks for your fast comment.

I want to make Client site made by Java, not javascript.
I tried some libraries(Jetty, tylus..) which are supporting websocket api, but those are all connection failed. exactly(connection time out). after making simple server using the same port and same url, It worked.

Could you give a comment for success? Anything is OK.

Here is Client site code.

Application.java

public class Application {
	
	

	public static void main(String[] args) throws URISyntaxException, IOException {
		// TODO Auto-generated method stub
		new Application().run(new URI("wss://localhost:8443/signaling/"));
		
	}
	
	public void run(URI destinationUri) throws IOException{
		// TODO Auto-generated method stub
        SslContextFactory sslContextFactory = new SslContextFactory();
        Resource keyStoreResource = Resource.newResource(this.getClass().getResource("/keystore.jks"));
        sslContextFactory.setKeyStoreResource(keyStoreResource);
        sslContextFactory.setKeyStorePassword("123456");
        sslContextFactory.setKeyManagerPassword("123456");
        WebSocketClient client = new WebSocketClient(sslContextFactory);
        MyWebSocket socket = new MyWebSocket();
        try {
            client.start();
            ClientUpgradeRequest request = new ClientUpgradeRequest();
            System.out.println("Connecting to : " + destinationUri);
            client.connect(socket, destinationUri, request);
            socket.awaitClose(5, TimeUnit.SECONDS); 
        } catch (Throwable t) {
            t.printStackTrace();
        } finally {
            try {
                client.stop();
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
	}


}

**
MyWebSocket.java
**

@WebSocket
public class MyWebSocket {
    private final CountDownLatch closeLatch = new CountDownLatch(1);

    @OnWebSocketConnect
    public void onConnect(Session session) {
        System.out.println("WebSocket Opened in client side");
        try {
            System.out.println("Sending message: Hi server");
            session.getRemote().sendString("Hi Server");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    @OnWebSocketMessage
    public void onMessage(String message) {
        System.out.println("Message from Server: " + message);
    }

    @OnWebSocketClose
    public void onClose(int statusCode, String reason) {
        System.out.println("WebSocket Closed. Code:" + statusCode);
    }

    public boolean awaitClose(int duration, TimeUnit unit) throws InterruptedException {
        return this.closeLatch.await(duration, unit);
    }

}

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

You're using native implementation of websocket for jetty. NextRTC is using JSR 356 standard. I think that it should be simple to rewrite implementation of endpoint to jetty native. You can try to do it on your own and share the results :)

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Thank you for your answer.

I am trying to search and find solutions, but it was failed.

Let me know more detail, if you have some ideas.
I have some questions about your comment.

The first thing ;
Do I need to make implementation of endpoint in client site?
I surely specify the server endpoint URL and private certificate related to server's.
In javascript site, it just specify webSocket object like "new WebSocket(URL)". It's successful.

And second thing;
in nextRTC signal server, server attached encoding and decoding class. I wonder every client site has the same things.

Thank you.

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Hi.
I will give you some information about my test results.

Firstly, I did test using Jetty version 9.4.
the all the things before version 9.1.x or 9.2.x were failed to connect, because they didn't offer the JSR 356 native. I think Tyrus has also some bugs in secured line socket.

Anyway, as I said, I tested nextRTC signal server focusing the sessions in increments.
When the number of clients is almost 10,000, the signal server has not responding at all. it just stop creating session.
If the session of clients which are created are released because of timeout or forced termination, the other clients request are successful to connect to Server.

  1. request 20,000 session to connect.
  2. almost 10,000 session, not specific number
    for example, after "9998" session is opened and did not responding, blocking(no exception)
  3. another process requests also are blocking.
  4. after session which are conneting to server are released, the other requests are accomplished.

I tried ;
1.jvm heap size up ; modified /.bash_profile
2.tomcat connection size up : application.properties.

I hope that you fixed this issues.

Thanks.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

this number 10k connections seems like some configuration property of
jetty.
=> I think this problem has nothing to do with Client and the number of client sockets.
because each time I tried, the number of sockets which are connected is different.
connection count ; 9994, 9991, 9996, 10001, 9889 like these...

also, when I use two clients,
Client 1 made 7,000 connections, it was success. without termination after that, client 2 tried to make 5,000 connections, almost 3,000 connections was made and the other connections were waiting for server response.

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

I've written that because I find in tomcat documentation something like this:

maxConnections
The maximum number of connections that the server will accept and process at any given time. When this number has been reached, the server will accept, but not process, one further connection. This additional connection be blocked until the number of connections being processed falls below maxConnections at which point the server will start accepting and processing new connections again. Note that once the limit has been reached, the operating system may still accept connections based on the acceptCount setting. The default value varies by connector type. For NIO and NIO2 the default is 10000. For APR/native, the default is 8192.
Note that for APR/native on Windows, the configured value will be reduced to the highest multiple of 1024 that is less than or equal to maxConnections. This is done for performance reasons.
If set to a value of -1, the maxConnections feature is disabled and connections are not counted.

I'll try to connect to server with highest number of connections, but I didn't write any logic for max number of clients ;)

from nextrtc-signaling-server.

akdk2001 avatar akdk2001 commented on September 22, 2024

Thanks.
I want to know how to set maxConnections configuration in spring-boot.
I don't know the property which is able to set maxConnections in application.properties.

Let me know if you know.

from nextrtc-signaling-server.

sidchoudhary avatar sidchoudhary commented on September 22, 2024

Hello,

I am able to run the example, and I integrated the example in my project successfully, but when i make connection I get userPrinciple as null. Can you please let me know how can i send user information when video connection is established ?

Also is it possible to send some extra information with NextRTC (using js files).

from nextrtc-signaling-server.

mslosarz avatar mslosarz commented on September 22, 2024

@sidchoudhary
There's project nextrtc-videochat-with-rest where you can find, how to configure security with nextRTC. If you want to find specific implementation just look here (service and handler)

You can post custom attributes in custom message field see doc

Best regards

from nextrtc-signaling-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.